5评论

0收藏

变色均线

avatar zzhhanngg12345 | 2270 人阅读 | 5 人评论 | 2019-08-23

/*
   Generated by ex4-to-mq4 decompiler (forex-warez.com) 4.0.509.5
   Website: WWw. f OR E x - war e z.COM
   E-mail : aN d r e yBb rV @GMA i L . c O m
*/
#property copyright "MT4 release WizardSerg <wizardserg@mail.ru>, ?? ??????? ForeXMagazine #104"
#property link      "wizardserg@mail.ru"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue

extern int period = 144;
extern int method = 3;
extern int price = 0;
double G_ibuf_88[];
double G_ibuf_92[];
double G_ibuf_96[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   IndicatorBuffers(3);
   SetIndexBuffer(0, G_ibuf_88);
   SetIndexBuffer(1, G_ibuf_92);
   SetIndexBuffer(2, G_ibuf_96);
   ArraySetAsSeries(G_ibuf_96, TRUE);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
   IndicatorShortName("Hull Moving Average(" + period + ")");
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   return (0);
}

// D954202506588335BC40071F1425E064
double f0_0(int Ai_0, int A_period_4) {
   return (iMA(NULL, 0, A_period_4, 0, method, price, Ai_0));
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double Lda_16[];
   double Lda_20[];
   int ind_counted_0 = IndicatorCounted();
   if (ind_counted_0 < 0) return (-1);
   int Li_4 = 0;
   int period_8 = MathSqrt(period);
   int Li_12 = Bars - ind_counted_0 + period + 1;
   if (Li_12 > Bars) Li_12 = Bars;
   ArrayResize(Lda_16, Li_12);
   ArraySetAsSeries(Lda_16, TRUE);
   ArrayResize(Lda_20, Li_12);
   ArraySetAsSeries(Lda_20, TRUE);
   for (Li_4 = 0; Li_4 < Li_12; Li_4++) Lda_16[Li_4] = 2.0 * f0_0(Li_4, period / 2) - f0_0(Li_4, period);
   for (Li_4 = 0; Li_4 < Li_12 - period; Li_4++) G_ibuf_96[Li_4] = iMAOnArray(Lda_16, 0, period_8, 0, method, Li_4);
   for (Li_4 = Li_12 - period; Li_4 >= 0; Li_4--) {
      Lda_20[Li_4] = Lda_20[Li_4 + 1];
      if (G_ibuf_96[Li_4] > G_ibuf_96[Li_4 + 1]) Lda_20[Li_4] = 1;
      if (G_ibuf_96[Li_4] < G_ibuf_96[Li_4 + 1]) Lda_20[Li_4] = -1;
      if (Lda_20[Li_4] > 0.0) {
         G_ibuf_88[Li_4] = G_ibuf_96[Li_4];
         if (Lda_20[Li_4 + 1] < 0.0) G_ibuf_88[Li_4 + 1] = G_ibuf_96[Li_4 + 1];
         G_ibuf_92[Li_4] = EMPTY_VALUE;
      } else {
         if (Lda_20[Li_4] < 0.0) {
            G_ibuf_92[Li_4] = G_ibuf_96[Li_4];
            if (Lda_20[Li_4 + 1] > 0.0) G_ibuf_92[Li_4 + 1] = G_ibuf_96[Li_4 + 1];
            G_ibuf_88[Li_4] = EMPTY_VALUE;
         }
      }
   }
   return (0);
}


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

评论|共 5 个

xiaxia886

发表于 2020-7-16 10:00:03 | 显示全部楼层

谢谢楼主分享

rickyliao

发表于 2020-7-30 20:57:58 | 显示全部楼层

谢谢楼主分享

live

发表于 2020-8-8 15:39:57 | 显示全部楼层

学习了,不错

icsbqfvc

发表于 2021-8-3 18:42:22 | 显示全部楼层

谢谢

铁窗泪

发表于 2024-10-25 11:00:12 | 显示全部楼层

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

EA之家评论守则