老王吧 发表于 2017-12-27 11:40:09

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);
}
//+------------------------------------------------------------------+


wang0563 发表于 2020-7-9 18:46:17

学习了,不错

sunny启悦 发表于 2020-7-24 15:57:25

谢谢楼主分享

齐心共赢 发表于 2020-7-27 16:47:03

谢谢楼主分享

TERENCES 发表于 2020-8-8 21:25:01

学习了,不错

fanhongli123 发表于 2020-8-16 17:26:17

帮你顶下哈!!

开户谨慎 发表于 2020-8-26 14:50:12

帮你顶下哈!!

523934532 发表于 2020-8-27 16:06:03

学习了,不错

姐就是这么靓 发表于 2020-9-1 10:32:00

学习了,不错

你的笑容 发表于 2020-9-1 14:07:31

谢谢楼主分享
页: [1] 2
查看完整版本: Hour指标,创建另类均线组