Hour指标,创建另类均线组
//+------------------------------------------------------------------+
//| 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=iMA(NULL,60,5,0,0,0,i/12);
ExtMapBuffer2=iMA(NULL,15,5,0,0,0,i/3);
ExtMapBuffer3=iMA(NULL,5,5,0,0,0,i);
}
return(rates_total);
}
//+------------------------------------------------------------------+
学习了,不错 谢谢楼主分享 谢谢楼主分享 学习了,不错 帮你顶下哈!! 帮你顶下哈!! 学习了,不错 学习了,不错 谢谢楼主分享
页:
[1]
2