Navigation´╝ÜHome > Content >

PBF_Squeeze(2).mq4

Time: 2017-06-18 | Download file:PBF_Squeeze(2).mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: H t T P: //w ww.ME t aQu oTe s . n e t
   E-mail : SuPp o Rt @metA Quo TeS. N e t
*/
#property copyright "Sagacity International Corp"
#property link      "http://www.paintbarforex.com"

#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_color4 Brown
#property indicator_color5 Lime
#property indicator_color6 Red

extern int Length = 21;
string Gs_kaufman3_80 = "Kaufman3";
double Gd_88 = 2.0;
double Gd_96 = 16.0;
int Gi_104 = 0;
bool Gi_unused_108 = TRUE;
double G_ibuf_112[];
double G_ibuf_116[];
double G_ibuf_120[];
double G_ibuf_124[];
double G_ibuf_128[];
double G_ibuf_132[];
double G_ibuf_136[];
double Gda_140[];
double Gda_144[];
double G_ibuf_148[100];
int Gi_152 = 10;
double Gda_156[];
double Gda_160[];
double Gda_164[];
double Gda_168[];
bool Gi_172 = TRUE;
datetime G_time_176;
double Gd_180 = 0.0;
double Gd_188 = 0.0;
double Gd_196 = 0.0;
double Gd_204 = 0.0;
double Gd_212 = 0.0;
double Gd_220 = 0.0;
double Gd_228 = 0.0;
double Gd_236 = 0.0;
double Gd_unused_244 = 0.0;
double Gd_252 = 0.0;
double Gd_260 = 0.0;
double Gd_268 = 0.0;
double Gd_276 = 0.0;
double Gd_284 = 0.0;
double Gd_292 = 0.0;
double Gd_unused_300 = 0.0;
double Gd_unused_308 = 0.0;
double Gd_unused_316 = 0.0;
double Gd_unused_324 = 0.0;
double Gd_unused_332 = 0.0;
double Gd_unused_340 = 0.0;
double Gd_unused_348 = 0.0;
int Gi_356 = 100;
int Gi_360 = 0;
double Gda_364[];
double Gda_368[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   Gi_152 = Length;
   IndicatorBuffers(8);
   SetIndexStyle(0, DRAW_HISTOGRAM);
   SetIndexStyle(1, DRAW_HISTOGRAM);
   SetIndexStyle(2, DRAW_HISTOGRAM);
   SetIndexStyle(3, DRAW_HISTOGRAM);
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexStyle(5, DRAW_ARROW);
   SetIndexArrow(4, 159);
   SetIndexArrow(5, 159);
   SetIndexBuffer(0, G_ibuf_112);
   SetIndexBuffer(1, G_ibuf_116);
   SetIndexBuffer(2, G_ibuf_120);
   SetIndexBuffer(3, G_ibuf_124);
   SetIndexBuffer(4, G_ibuf_128);
   SetIndexBuffer(5, G_ibuf_132);
   SetIndexBuffer(6, G_ibuf_136);
   SetIndexBuffer(7, G_ibuf_148);
   SetIndexLabel(0, "Plot0");
   SetIndexLabel(1, "Plot1");
   SetIndexLabel(2, "Plot2");
   SetIndexLabel(3, "Plot3");
   ArrayResize(Gda_156, Gi_152);
   ArrayResize(Gda_160, Gi_152);
   ArrayResize(Gda_164, Gi_152);
   ArrayResize(Gda_168, Gi_152);
   ArraySetAsSeries(Gda_156, TRUE);
   ArraySetAsSeries(Gda_160, TRUE);
   ArraySetAsSeries(Gda_164, TRUE);
   ArraySetAsSeries(Gda_168, TRUE);
   ArraySetAsSeries(Gda_140, TRUE);
   ArraySetAsSeries(Gda_144, TRUE);
   ArrayResize(Gda_140, Bars);
   ArrayResize(Gda_144, Bars);
   Gi_172 = TRUE;
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   string Ls_unused_0;
   double ima_on_arr_8;
   int Li_unused_16;
   int Li_20;
   int Li_24;
   double icustom_28;
   double Ld_36;
   double Ld_44;
   int Li_52 = IndicatorCounted();
   if (Li_52 < 0) return (-1);
   if (Li_52 > 0) Li_52--;
   if (Li_52 > 0) Li_52--;
   int Li_56 = Bars - Li_52;
   Li_56 = MathMax(Gi_152, Bars - Li_52);
   bool Li_60 = FALSE;
   if (G_time_176 != Time[0]) Li_60 = TRUE;
   G_time_176 = Time[0];
   if (Li_60) {
      ArrayResize(Gda_140, Bars);
      ArrayResize(Gda_144, Bars);
      for (int Li_64 = Bars - 1; Li_64 >= 0; Li_64--) {
         Gda_140[Li_64] = Close[Li_64] - (Close[Li_64 + 1]);
         Gda_144[Li_64] = MathAbs(Close[Li_64 + 1]);
      }
   } else {
      for (Li_64 = Li_56 - 1; Li_64 >= 0; Li_64--) {
         Gda_140[Li_64] = Close[Li_64] - (Close[Li_64 + 1]);
         Gda_144[Li_64] = MathAbs(Close[Li_64 + 1]);
      }
   }
   for (Li_64 = Li_56 - 1; Li_64 >= 0; Li_64--) G_ibuf_136[Li_64] = f0_0(Length, 4, 4, Gda_140, Gda_144, Li_64);
   for (Li_64 = Li_56 - 1; Li_64 >= 0; Li_64--) {
      G_ibuf_148[Li_64] = iMAOnArray(G_ibuf_136, 0, 3, 0, MODE_EMA, Li_64);
      ima_on_arr_8 = iMAOnArray(G_ibuf_136, 0, 7, 0, MODE_EMA, Li_64);
      Li_unused_16 = 11;
      Li_20 = 2;
      Li_24 = 11;
      icustom_28 = iCustom(NULL, 0, Gs_kaufman3_80, Li_20, Li_20, Li_24, Gd_88, Gd_96, Gi_104, 0, Li_64);
      Ld_36 = f0_1(Close, 0, 9, Li_64);
      Ld_44 = Ld_36 - icustom_28;
      G_ibuf_128[Li_64] = EMPTY_VALUE;
      G_ibuf_132[Li_64] = EMPTY_VALUE;
      if (Ld_44 > 0.0) G_ibuf_128[Li_64] = 0;
      if (Ld_44 < 0.0) G_ibuf_132[Li_64] = 0;
      G_ibuf_112[Li_64] = EMPTY_VALUE;
      G_ibuf_116[Li_64] = EMPTY_VALUE;
      G_ibuf_120[Li_64] = EMPTY_VALUE;
      G_ibuf_124[Li_64] = EMPTY_VALUE;
      if (G_ibuf_136[Li_64] > 0.0 && G_ibuf_136[Li_64] >= G_ibuf_148[Li_64]) G_ibuf_112[Li_64] = G_ibuf_136[Li_64];
      else {
         if ((G_ibuf_136[Li_64] > 0.0 && G_ibuf_136[Li_64] > ima_on_arr_8 && G_ibuf_136[Li_64] < G_ibuf_148[Li_64]) || (G_ibuf_136[Li_64] < 0.0 && G_ibuf_136[Li_64] > ima_on_arr_8)) G_ibuf_120[Li_64] = G_ibuf_136[Li_64];
         else {
            if (G_ibuf_136[Li_64] < 0.0 && G_ibuf_136[Li_64] <= G_ibuf_148[Li_64]) G_ibuf_116[Li_64] = G_ibuf_136[Li_64];
            else
               if ((G_ibuf_136[Li_64] < 0.0 && G_ibuf_136[Li_64] > G_ibuf_148[Li_64] && G_ibuf_136[Li_64] < ima_on_arr_8) || (G_ibuf_136[Li_64] > 0.0 && G_ibuf_136[Li_64] < G_ibuf_148[Li_64])) G_ibuf_124[Li_64] = G_ibuf_136[Li_64];
         }
      }
   }
   return (0);
}

// 945D754CB0DC06D04243FCBA25FC0802
double f0_0(int A_period_0, int A_period_4, int A_period_8, double Ada_12[], double Ada_16[], int Ai_20) {
   int Li_24 = MathMin(ArraySize(Gda_156), ArraySize(Ada_12));
   for (int Li_28 = Li_24 - 1; Li_28 >= 0; Li_28--) Gda_156[Li_28] = iMAOnArray(Ada_12, 0, A_period_0, 0, MODE_EMA, Ai_20 + Li_28);
   for (Li_28 = Li_24 - 1; Li_28 >= 0; Li_28--) Gda_160[Li_28] = iMAOnArray(Gda_156, 0, A_period_4, 0, MODE_EMA, Li_28);
   double Ld_32 = 100.0 * iMAOnArray(Gda_160, 0, A_period_8, 0, MODE_EMA, 0);
   for (Li_28 = Li_24 - 1; Li_28 >= 0; Li_28--) Gda_164[Li_28] = iMAOnArray(Ada_16, 0, A_period_0, 0, MODE_EMA, Ai_20 + Li_28);
   for (Li_28 = Li_24 - 1; Li_28 >= 0; Li_28--) Gda_168[Li_28] = iMAOnArray(Gda_164, 0, A_period_4, 0, MODE_EMA, Li_28);
   double ima_on_arr_40 = iMAOnArray(Gda_168, 0, A_period_8, 0, MODE_EMA, 0);
   if (ima_on_arr_40 != 0.0) return (Ld_32 / ima_on_arr_40);
   return (0);
}

// 9B1AEE847CFB597942D106A4135D4FE6
double f0_1(double Ada_0[], int Ai_4, int Ai_8, int Ai_12) {
   if (Gi_172) {
      Gi_172 = FALSE;
      Gi_360 = Ai_8;
      if (Gi_360 > Gi_356) Gi_360 = Gi_356;
      if (Gi_360 < 2) Gi_360 = 2;
      ArrayResize(Gda_364, MathMax(Gi_360, Gi_356));
      ArrayResize(Gda_368, MathMax(Gi_360, Gi_356));
   }
   for (int Li_16 = 1; Li_16 <= Gi_360; Li_16++) {
      Gda_368[Li_16] = Li_16 - 1;
      Gda_364[Li_16] = Ada_0[Ai_12 + Li_16 - 1];
   }
   Gd_180 = 0;
   Gd_188 = 0;
   for (Li_16 = 1; Li_16 <= Gi_360; Li_16++) {
      Gd_180 += Gda_368[Li_16];
      Gd_188 += Gda_364[Li_16];
   }
   if (Gi_360 != 0) {
      Gd_180 /= Gi_360;
      Gd_188 /= Gi_360;
   }
   Gd_220 = 0;
   Gd_228 = 0;
   Gd_236 = 0;
   Gd_252 = 0;
   Gd_260 = 0;
   Gd_268 = 0;
   for (Li_16 = 1; Li_16 <= Gi_360; Li_16++) {
      Gd_196 = Gda_368[Li_16] - Gd_180;
      Gd_204 = Gda_364[Li_16] - Gd_188;
      Gd_212 = Gda_368[Li_16] * Gda_368[Li_16] - Gd_180 * Gd_180;
      Gd_220 += Gd_196 * Gd_196;
      Gd_228 += Gd_196 * Gd_204;
      Gd_236 += Gd_204 * Gd_204;
      Gd_252 += Gd_196 * Gd_212;
      Gd_260 += Gd_212 * Gd_212;
      Gd_268 += Gd_204 * Gd_212;
   }
   double Ld_20 = Gd_220 * Gd_260 - Gd_252 * Gd_252;
   if (Ld_20 != 0.0) {
      Gd_284 = (Gd_228 * Gd_260 - Gd_268 * Gd_252) / Ld_20;
      Gd_292 = (Gd_220 * Gd_268 - Gd_252 * Gd_228) / Ld_20;
   }
   Gd_276 = Gd_188 - Gd_284 * Gd_180 - Gd_292 * Gd_180 * Gd_180;
   return (Gd_276 + Gd_284 * Ai_4 + Gd_292 * Ai_4 * Ai_4);
}

Recommend