Navigation´╝ÜHome > Content >

RE_Index~.mq4

Time: 2013-02-08 | Download file:RE_Index~.mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: h t Tp:// Www.me t a qUO tEs. nE T
   E-mail : suP po rT @ mE T AQuOt E s . n eT
*/

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_width1 1
#property indicator_level1 60.0
#property indicator_level2 -60.0

extern int REI_Period = 8;
double G_ibuf_80[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   IndicatorBuffers(1);
   IndicatorShortName("RE Index (" + REI_Period + ")");
   SetIndexBuffer(0, G_ibuf_80);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexDrawBegin(0, REI_Period + 8);
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double Ld_12;
   double Ld_20;
   if (Bars <= REI_Period + 8) return (0);
   int Li_0 = IndicatorCounted();
   if (Li_0 > 0) Li_0--;
   int Li_4 = Bars - Li_0;
   for (int index_8 = 0; index_8 <= Li_4; index_8++) {
      Ld_12 = 0;
      Ld_20 = 0;
      for (int count_28 = 0; count_28 < REI_Period; count_28++) {
         Ld_12 += f0_1(index_8 + count_28);
         Ld_20 += f0_0(index_8 + count_28);
      }
      if (Ld_20 != 0.0) G_ibuf_80[index_8] = 100.0 * (Ld_12 / Ld_20);
      else G_ibuf_80[index_8] = 0;
   }
   return (0);
}

// D20A66EB87568D19BE011E80DCCC6CDA
double f0_1(int Ai_0) {
   int Li_20;
   int Li_24;
   double Ld_4 = High[Ai_0] - (High[Ai_0 + 2]);
   double Ld_12 = Low[Ai_0] - (Low[Ai_0 + 2]);
   if (High[Ai_0 + 2] < Close[Ai_0 + 7] && High[Ai_0 + 2] < Close[Ai_0 + 8] && High[Ai_0] < High[Ai_0 + 5] && High[Ai_0] < High[Ai_0 + 6]) Li_20 = 0;
   else Li_20 = 1;
   if (Low[Ai_0 + 2] > Close[Ai_0 + 7] && Low[Ai_0 + 2] > Close[Ai_0 + 8] && Low[Ai_0] > Low[Ai_0 + 5] && Low[Ai_0] > Low[Ai_0 + 6]) Li_24 = 0;
   else Li_24 = 1;
   return (Li_20 * Li_24 * (Ld_4 + Ld_12));
}

// 4F7E651FE95578D11C1E65A0D9BBC152
double f0_0(int Ai_0 = 0) {
   double Ld_4 = MathAbs(High[Ai_0] - (High[Ai_0 + 2]));
   double Ld_12 = MathAbs(Low[Ai_0] - (Low[Ai_0 + 2]));
   return (Ld_4 + Ld_12);
}

Recommend