10评论

1收藏

i-GentorLSMA&amp EMA v.0.2

avatar 老王吧 | 4531 人阅读 | 10 人评论 | 2017-12-27

XAUUSDH1.png

  1. #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
  2. #property link      "http://www.eazhijia.com"
  3. //----
  4. #property indicator_separate_window
  5. #property indicator_buffers 4
  6. #property indicator_color1 Yellow
  7. #property indicator_color2 Blue
  8. #property indicator_color3 Red
  9. #property indicator_color4 Lime
  10. //---- 马屮龛?镟疣戾蝠?---------------------------------------------
  11. extern int EMAPeriod =34;  // 襄痂钿 盘?
  12. extern int LSMAPeriod=25;  // 襄痂钿 LSMA
  13. //---- 馏翦瘥 桧滂赅蝾疣 ---------------------------------------------
  14. double LineHighEMA[];
  15. double LineLowEMA[];
  16. double LSMABuffer1[];
  17. double LSMABuffer2[];
  18. //+------------------------------------------------------------------+
  19. //| Custom indicator initialization function                         |
  20. //+------------------------------------------------------------------+
  21.   void init()
  22.   {
  23.    IndicatorDigits(2);
  24.    SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 3);
  25.    SetIndexBuffer(0, LineHighEMA);
  26.    SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 3);
  27.    SetIndexBuffer(1, LineLowEMA);
  28.    SetIndexBuffer(2, LSMABuffer1);
  29.    SetIndexStyle (2, DRAW_LINE, STYLE_SOLID, 3);
  30.    SetIndexBuffer(3, LSMABuffer2);
  31.    SetIndexStyle (3, DRAW_LINE, STYLE_SOLID, 3);
  32.    Comment("");
  33.   }
  34. //+------------------------------------------------------------------+
  35. //| Custor indicator deinitialization function                       |
  36. //+------------------------------------------------------------------+
  37.   void deinit()
  38.   {
  39.    Comment("");
  40.   }
  41. //+------------------------------------------------------------------+
  42. //| Custom indicator iteration function                              |
  43. //+------------------------------------------------------------------+
  44.   int start()
  45.   {
  46.    int i, shift, counted_bars=IndicatorCounted();
  47.    int Draw4HowLong, loopbegin;
  48.    double sum, lengthvar, tmp, wt;
  49. //----
  50.    if (counted_bars<0) return;
  51.    if (counted_bars>0) counted_bars--;
  52.    counted_bars=Bars - counted_bars;
  53.      for(shift=0; shift<counted_bars; shift++)
  54.      {
  55.       LineLowEMA[shift]=-1;
  56.       LineHighEMA[shift]=-1;
  57. //----
  58.       double EmaValue=iMA(NULL, 0, EMAPeriod, 0, MODE_EMA, PRICE_TYPICAL, shift);
  59.       if (Close[shift] > EmaValue) LineHighEMA[shift]=EMPTY_VALUE;
  60.       else
  61.          if (Close[shift] < EmaValue) LineLowEMA[shift]=EMPTY_VALUE;
  62.      }
  63.    Draw4HowLong=Bars-LSMAPeriod - 5;
  64.    loopbegin=Draw4HowLong - LSMAPeriod - 1;
  65. //----
  66.      for(shift=loopbegin; shift>=0; shift--)
  67.      {
  68.       sum=0;
  69.         for(i=LSMAPeriod; i>=1; i--)
  70.         {
  71.          lengthvar=LSMAPeriod + 1;
  72.          lengthvar/=3;
  73.          tmp=0;
  74.          tmp=(i - lengthvar)*Close[LSMAPeriod-i+shift];
  75.          sum+=tmp;
  76.         }
  77.       wt=sum*6/(LSMAPeriod*(LSMAPeriod+1));
  78. //----
  79.       LSMABuffer1[shift]=1;
  80.       LSMABuffer2[shift]=1;
  81. //----
  82.       if (wt > Close[shift]) LSMABuffer2[shift]=EMPTY_VALUE;
  83.       else
  84.          if (wt < Close[shift]) LSMABuffer1[shift]=EMPTY_VALUE;
  85.      }
  86.   }
  87. //+------------------------------------------------------------------+
复制代码


i-GentorLSMAoEMA_vh11_0_2.mq4
""
还没有人打赏,支持一下

评论|共 10 个

3568

发表于 2019-2-22 01:09:39 | 显示全部楼层

感謝您的分享!!

ztruccos122

发表于 2020-1-5 17:21:54 | 显示全部楼层

沙发!沙发!

uoykp

发表于 2020-1-16 18:27:31 | 显示全部楼层

前排支持下

唯儿

发表于 2020-8-5 22:32:45 | 显示全部楼层

帮你顶下哈!!

把握商机

发表于 2020-8-6 12:19:16 | 显示全部楼层

帮你顶下哈!!

ok按臣工

发表于 2020-8-25 11:07:23 | 显示全部楼层

帮你顶下哈!!

如果爱忘了

发表于 2020-11-7 15:22:54 | 显示全部楼层

钱奎通

发表于 2021-7-15 11:22:39 | 显示全部楼层

谢谢

EA狙击手

发表于 2021-7-22 21:41:15 | 显示全部楼层

顶下

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

EA之家评论守则