- //+------------------------------------------------------------------+
- //| Hour.mq4 |
- //| Copyright @2006, metaQuotes Software Corp. |
- //+------------------------------------------------------------------+
- #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
- #property link "http://www.eazhijia.com"
- #property strict
- #property indicator_chart_window
- #property indicator_buffers 3
- #property indicator_color1 Blue
- #property indicator_color2 Yellow
- #property indicator_color3 Red
- double ExtMapBuffer1[];
- double ExtMapBuffer2[];
- double ExtMapBuffer3[];
- //+------------------------------------------------------------------+
- //| Custom indicator initialization function |
- //+------------------------------------------------------------------+
- void onInit(void)
- {
- SetIndexStyle(0,DRAW_LINE);
- SetIndexBuffer(0,ExtMapBuffer1);
- SetIndexStyle(1,DRAW_LINE);
- SetIndexBuffer(1,ExtMapBuffer2);
- SetIndexStyle(2,DRAW_LINE);
- SetIndexBuffer(2,ExtMapBuffer3);
- Comment("www.eazhijia.com");
- }
- //+------------------------------------------------------------------+
- //| Custom indicator iteration function |
- //+------------------------------------------------------------------+
- 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;
- limit=rates_total-prev_calculated;
- if(prev_calculated>0)
- limit++;
- for(i=0; i<limit; i++)
- {
- ExtMapBuffer1[i]=iMA(NULL,60,5,0,0,0,i/12);
- ExtMapBuffer2[i]=iMA(NULL,15,5,0,0,0,i/3);
- ExtMapBuffer3[i]=iMA(NULL,5,5,0,0,0,i);
- }
- return(rates_total);
- }
- //+------------------------------------------------------------------+
|