SHARE
TWEET

Untitled

a guest Feb 20th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //+------------------------------------------------------------------+
  2. //|                                                super-signals.mq4 |
  3. //|                Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
  4. //+------------------------------------------------------------------+
  5. #property copyright "Copyright © 2006, Nick Bilak"
  6. #property link      "http://www.forex-tsd.com/"
  7.  
  8. #property indicator_chart_window
  9. #property indicator_buffers 2
  10. #property indicator_color1 Red
  11. #property indicator_color2 Aqua
  12.  
  13. extern int SignalGap=10;
  14.  
  15. int dist=50;
  16. double b1[];
  17. double b2[];
  18.  
  19. //+------------------------------------------------------------------+
  20. //|                                                                  |
  21. //+------------------------------------------------------------------+
  22.   int init()  {
  23.    SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);
  24.    SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);
  25.    SetIndexArrow(1,233);
  26.    SetIndexArrow(0,234);
  27.    SetIndexBuffer(0,b1);
  28.    SetIndexBuffer(1,b2);
  29.    return(0);
  30.   }
  31. //+------------------------------------------------------------------+
  32. //|                                                                  |
  33. //+------------------------------------------------------------------+
  34.   int start() {
  35.    int counted_bars=IndicatorCounted();
  36.    int k,i,j,limit,hhb,llb;
  37.  
  38.    if (counted_bars<0) return(-1);
  39.    if (counted_bars>0) counted_bars--;
  40.    limit=Bars-1;
  41.    if(counted_bars>=1) limit=Bars-counted_bars-1;
  42.    if (limit<0) limit=0;
  43.  
  44.      for(i=limit;i>=0;i--)   {
  45.       hhb=Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
  46.       llb=Lowest(NULL,0,MODE_LOW,dist,i-dist/2);
  47.  
  48.       if (i==hhb)
  49.          b1[i]=High[hhb]+SignalGap*Point;
  50.       if (i==llb)
  51.          b2[i]=Low[llb]-SignalGap*Point;
  52.      }
  53.      if (((TriggerCandle > 0) && (Time[0] > LastAlertTime)) || (TriggerCandle == 0))
  54. {
  55.     string Text;
  56.     // Up Arrow Alert
  57.     if ((dUpCCIBuffer[TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
  58.     {
  59.         Text = AlertText + "SignalGap " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Up.";
  60.         if (EnableNativeAlerts) Alert(Text);
  61.         if (EnableEmailAlerts) SendMail(AlertEmailSubject + "SignalGap", Text);
  62.         if (EnableSoundAlerts) PlaySound(SoundFileName);
  63.         LastAlertTime = Time[0];
  64.         LastAlertDirection = 1;
  65.     }
  66.     // Down Arrow Alert
  67.     if ((dUpCCIBuffer[TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != -1))))
  68.     {
  69.         Text = AlertText + "SignalGap " + Symbol() + " - " + EnumToString((ENUM_TIMEFRAMES)Period()) + " - Down.";
  70.         if (EnableNativeAlerts) Alert(Text);
  71.         if (EnableEmailAlerts) SendMail(AlertEmailSubject + "SignalGap\", Text);
  72.         if (EnableSoundAlerts) PlaySound(SoundFileName);
  73.         LastAlertTime = Time[0];
  74.         LastAlertDirection = -1;
  75.     }
  76.    return(0);
  77.   }
  78.  
  79. //+------------------------------------------------------------------+
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top