- //+------------------------------------------------------------------+
- //| super-signals.mq4 |
- //| Copyright @2006, Nick Bilak, beluck[AT]gmail.com |
- //+------------------------------------------------------------------+
- #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
- #property link "http://www.eazhijia.com"
- #property indicator_chart_window
- #property indicator_buffers 2
- #property indicator_color1 Red
- #property indicator_width1 2
- #property indicator_color2 Lime
- #property indicator_width2 2
- input int SignalGap = 4;
- int dist=24;
- double b1[];
- double b2[];
- void onInit(void)
- {
- SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);
- SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);
- SetIndexArrow(1,233);
- SetIndexArrow(0,234);
- SetIndexBuffer(0,b1);
- SetIndexBuffer(1,b2);
- }
- int onCalculate(const int rates_total,
- const int prev_calculated,
- const datetime &time[],
- const double &open[],
- const double &high[],
- const double &low[],
- const double &close[],
- const long &tick_volume[],
- const long &volume[],
- const int &spread[])
- {
- int i,limit,hhb,llb;
- if(rates_total<=SignalGap)
- return(0);
- limit=rates_total-prev_calculated;
- if(prev_calculated>0)
- limit++;
- for (i=limit;i>=0;i--) {
- hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
- llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);
- if (i==hhb)
- b1[i]=High[hhb]+SignalGap*Point;
- if (i==llb)
- b2[i]=Low[llb]-SignalGap*Point;
- }
- return(rates_total);
- }
|