zzhhanngg12345 发表于 2019-8-23 01:41:05

变色均线

/*
   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 = 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 = iMAOnArray(Lda_16, 0, period_8, 0, method, Li_4);
   for (Li_4 = Li_12 - period; Li_4 >= 0; Li_4--) {
      Lda_20 = Lda_20;
      if (G_ibuf_96 > G_ibuf_96) Lda_20 = 1;
      if (G_ibuf_96 < G_ibuf_96) Lda_20 = -1;
      if (Lda_20 > 0.0) {
         G_ibuf_88 = G_ibuf_96;
         if (Lda_20 < 0.0) G_ibuf_88 = G_ibuf_96;
         G_ibuf_92 = EMPTY_VALUE;
      } else {
         if (Lda_20 < 0.0) {
            G_ibuf_92 = G_ibuf_96;
            if (Lda_20 > 0.0) G_ibuf_92 = G_ibuf_96;
            G_ibuf_88 = EMPTY_VALUE;
         }
      }
   }
   return (0);
}


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

{:1_180:}

深深的蓝 发表于 2025-3-22 14:45:57

谢谢
页: [1]
查看完整版本: 变色均线