15评论

2收藏

Hour指标,创建另类均线组

avatar 老王吧 | 2243 人阅读 | 15 人评论 | 2017-12-27

USDJPYM30.png

  1. //+------------------------------------------------------------------+
  2. //|                                                         Hour.mq4 |
  3. //|                       Copyright @2006, MetaQuotes Software Corp. |
  4. //+------------------------------------------------------------------+
  5. #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
  6. #property link      "http://www.eazhijia.com"
  7. #property strict

  8. #property indicator_chart_window
  9. #property indicator_buffers 3
  10. #property indicator_color1 Blue
  11. #property indicator_color2 Yellow
  12. #property indicator_color3 Red

  13. double ExtMapBuffer1[];
  14. double ExtMapBuffer2[];
  15. double ExtMapBuffer3[];
  16. //+------------------------------------------------------------------+
  17. //| Custom indicator initialization function                         |
  18. //+------------------------------------------------------------------+
  19. void OnInit(void)
  20.   {
  21.    SetIndexStyle(0,DRAW_LINE);
  22.    SetIndexBuffer(0,ExtMapBuffer1);
  23.    SetIndexStyle(1,DRAW_LINE);
  24.    SetIndexBuffer(1,ExtMapBuffer2);
  25.    SetIndexStyle(2,DRAW_LINE);
  26.    SetIndexBuffer(2,ExtMapBuffer3);
  27.    Comment("www.eazhijia.com");
  28.   }
  29. //+------------------------------------------------------------------+
  30. //| Custom indicator iteration function                              |
  31. //+------------------------------------------------------------------+
  32. int OnCalculate(const int rates_total,
  33.                 const int prev_calculated,
  34.                 const datetime &time[],
  35.                 const double &open[],
  36.                 const double &high[],
  37.                 const double &low[],
  38.                 const double &close[],
  39.                 const long &tick_volume[],
  40.                 const long &volume[],
  41.                 const int &spread[])
  42.   {
  43.    int i,limit;
  44.    limit=rates_total-prev_calculated;
  45.    if(prev_calculated>0)
  46.       limit++;
  47.    for(i=0; i<limit; i++)
  48.      {
  49.       ExtMapBuffer1[i]=iMA(NULL,60,5,0,0,0,i/12);
  50.       ExtMapBuffer2[i]=iMA(NULL,15,5,0,0,0,i/3);
  51.       ExtMapBuffer3[i]=iMA(NULL,5,5,0,0,0,i);
  52.      }
  53.    return(rates_total);
  54.   }
  55. //+------------------------------------------------------------------+
复制代码


Hour.mq4
""
还没有人打赏,支持一下

评论|共 15 个

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 | 显示全部楼层

谢谢楼主分享

12下一页
您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则