Navigation:Home > Content >

caterpillar_v3_mod_1.mq4

Time: 2011-06-13 | Download file:caterpillar_v3_mod_1.mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: h TT P : // WW W .m eT a QUo Te s .nET
   E-mail :  s U P Po R T @ met AQu OT e s . N E t
*/
#property copyright "Copyright ?2007, klot"
#property link      "klot@mail.ru"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 CLR_NONE
#property indicator_color2 Lime
#property indicator_color3 Red

//#include 
/*
#import "SSA.ex4"
   void f0_4(double& a0[], int a1, int a2, int a3, double& a4[]); // 703552D9767ED5E725526033DF827BEC
#import
*/
extern int Lag = 30;
extern int NumComps = 4;
extern int N = 300;
extern int PRICE = 0;
double G_ibuf_92[];
double G_ibuf_96[];
double G_ibuf_100[];
double Gda_104[];
int Gi_76 = 20;
int Gi_80 = 100;
int Gi_84 = 500;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   ArrayResize(Gda_104, N);
   IndicatorBuffers(3);
   SetIndexBuffer(0, G_ibuf_92);
   SetIndexStyle(0, DRAW_LINE, EMPTY, 2);
   SetIndexBuffer(1, G_ibuf_96);
   SetIndexBuffer(2, G_ibuf_100);
   ArrayInitialize(G_ibuf_96, EMPTY_VALUE);
   ArrayInitialize(G_ibuf_100, EMPTY_VALUE);
   return (0);
}

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

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int ind_counted_0 = IndicatorCounted();
   SetIndexDrawBegin(0, Bars - N);
   for (int Li_4 = N - 1; Li_4 >= 0; Li_4--) Gda_104[Li_4] = iMA(NULL, 0, 1, 0, MODE_SMA, PRICE, Li_4);
   f0_4(Gda_104, N, Lag, NumComps, G_ibuf_92);
   for (Li_4 = 299; Li_4 >= 0; Li_4--) {
      if (G_ibuf_92[Li_4] > G_ibuf_92[Li_4 + 1]) {
         G_ibuf_96[Li_4] = G_ibuf_92[Li_4];
         G_ibuf_96[Li_4 + 1] = G_ibuf_92[Li_4 + 1];
      }
      if (G_ibuf_92[Li_4] < G_ibuf_92[Li_4 + 1]) {
         G_ibuf_100[Li_4] = G_ibuf_92[Li_4];
         G_ibuf_100[Li_4 + 1] = G_ibuf_92[Li_4 + 1];
      }
   }
   return (0);
}

void f0_4(double& Ada_0[], int Ai_4, int Ai_8, int Ai_12, double &Ada_16[]) {
   double Lda_20[100][100];
   double Lda_24[100][200];
   double Lda_28[100][100];
   int Li_32;
   int Li_36;
   double Lda_60[100][100];
   double Lda_64[100][100];
   double Lda_68[100];
   double Lda_72[100];
   if (Ai_8 > Gi_80) Ai_8 = Gi_80;
   if (Ai_12 > Gi_76) Ai_12 = Gi_76;
   if (Ai_12 > Ai_8) Ai_12 = Ai_8;
   if (Ai_4 > Gi_84) Ai_4 = Gi_84;
   int index_52 = 0;
   int Li_44 = Ai_4 - Ai_8 + 1;
   for (int index_48 = 0; index_48 <= Ai_8 - 1; index_48++) {
      for (index_52 = 0; index_52 <= Ai_8 - 1; index_52++) {
         Lda_20[index_48][index_52] = 0;
         for (int index_40 = 0; index_40 <= Li_44 - 1; index_40++) {
            Lda_20[index_48][index_52] += (Ada_0[index_48 + index_40]) * (Ada_0[index_40 + index_52]);
            Lda_24[index_40][index_52] = Ada_0[index_40 + index_52];
         }
      }
   }
   for (index_48 = 0; index_48 <= Ai_12 - 1; index_48++) {
      Lda_68[index_48] = f0_2(Lda_20, Ai_8 - index_48, Ai_8);
      f0_3(Lda_20, Lda_68[index_48], Ai_8, Lda_72);
      for (index_52 = 0; index_52 <= Ai_8 - 1; index_52++) Lda_60[index_48][index_52] = Lda_72[index_52];
   }
   for (int index_56 = 0; index_56 <= Ai_12 - 1; index_56++) {
      for (index_48 = 0; index_48 <= Li_44 - 1; index_48++) {
         Lda_64[index_56][index_48] = 0;
         for (index_52 = 0; index_52 <= Ai_8 - 1; index_52++) Lda_64[index_56][index_48] += Lda_24[index_48][index_52] * Lda_60[index_56][index_52];
      }
      for (index_48 = 0; index_48 <= Ai_8 - 1; index_48++) for (index_52 = 0; index_52 <= Li_44 - 1; index_52++) Lda_28[index_48][index_52] = Lda_60[index_56][index_48] * Lda_64[index_56][index_52];
      Li_32 = Li_44;
      Li_36 = Ai_8;
      for (index_48 = 0; index_48 <= Ai_4 - 1; index_48++) {
         Lda_64[index_56][index_48] = 0;
         if (index_48 < Li_36 - 1) {
            for (index_52 = 0; index_52 <= index_48; index_52++) {
               if (Ai_8 <= Li_44) Lda_64[index_56][index_48] += (Lda_28[index_52][index_48 - index_52]);
               if (Ai_8 > Li_44) Lda_64[index_56][index_48] += (Lda_28[index_48 - index_52][index_52]);
            }
            Lda_64[index_56][index_48] = Lda_64[index_56][index_48] / (1.0 * (index_48 + 1));
         }
         if (Li_36 - 1 <= index_48 && index_48 < Li_32 - 1) {
            for (index_52 = 0; index_52 <= Li_36 - 1; index_52++) {
               if (Ai_8 <= Li_44) Lda_64[index_56][index_48] += (Lda_28[index_52][index_48 - index_52]);
               if (Ai_8 > Li_44) Lda_64[index_56][index_48] += (Lda_28[index_48 - index_52][index_52]);
            }
            Lda_64[index_56][index_48] = Lda_64[index_56][index_48] / (1.0 * Li_36);
         }
         if (Li_32 - 1 <= index_48) {
            for (index_52 = index_48 - Li_32 + 1; index_52 <= Ai_4 - Li_32; index_52++) {
               if (Ai_8 <= Li_44) Lda_64[index_56][index_48] += (Lda_28[index_52][index_48 - index_52]);
               if (Ai_8 > Li_44) Lda_64[index_56][index_48] += (Lda_28[index_48 - index_52][index_52]);
            }
            Lda_64[index_56][index_48] = Lda_64[index_56][index_48] / (1.0 * (Ai_4 - index_48));
         }
      }
   }
   for (index_48 = 0; index_48 <= Ai_4 - 1; index_48++) {
      Ada_16[index_48] = 0;
      for (index_56 = 0; index_56 <= Ai_12 - 1; index_56++) Ada_16[index_48] += Lda_64[index_56][index_48];
   }
}

// 486EED770F6E8A0F76CAFB115182EC8F
double f0_2(double &Ada_0[][], int Ai_4, int Ai_8) {
   double Ld_28;
   double Ld_52;
   double Ld_20 = 0;
   for (int index_60 = 0; index_60 <= Ai_8 - 1; index_60++) {
      Ld_28 = 0;
      for (int count_64 = 0; count_64 <= Ai_8 - 1; count_64++) Ld_28 += Ada_0[index_60][count_64];
      if (Ld_20 < Ld_28) Ld_20 = Ld_28;
   }
   double Ld_36 = 0;
   double Ld_44 = 10.0 * Ld_20;
   double Ld_12 = 1.0 * Ld_20 / 10000000.0;
   while (MathAbs(Ld_44 - Ld_36) > Ld_12) {
      Ld_52 = 1.0 * (Ld_36 + Ld_44) / 2.0;
      if (f0_1(Ada_0, Ld_52, Ai_8) < Ai_4) Ld_36 = Ld_52;
      else Ld_44 = Ld_52;
   }
   return ((Ld_36 + Ld_44) / 2.0);
}

// 498748F6A2673B337A2CF4C74C6FE055
void f0_3(double &Ada_0[][], double Ad_4, int Ai_12, double &Ada_16[]) {
   int Li_24;
   double Lda_40[200][200];
   double Ld_44;
   double Lda_52[];
   ArrayResize(Lda_52, Ai_12);
   f0_5(Lda_40, Ada_0);
   for (int index_28 = 0; index_28 <= Ai_12 - 1; index_28++) Lda_40[index_28][index_28] = Lda_40[index_28][index_28] - Ad_4;
   int count_20 = 0;
   for (int index_36 = 0; index_36 <= Ai_12 - 2; index_36++) {
      for (index_28 = index_36 + 1; index_28 <= Ai_12 - 1; index_28++) {
         if (Lda_40[index_36][index_36] == 0.0) {
            Li_24 = 0;
            while (index_28 <= Ai_12 - 1) {
               Lda_52[Li_24] = Lda_40[Li_24][index_36];
               Lda_40[Li_24][index_36] = Lda_40[Li_24][index_36 + 1];
               Lda_40[Li_24][index_36 + 1] = Lda_52[Li_24];
               index_28++;
            }
            count_20++;
         }
         Ld_44 = 1.0 * Lda_40[index_28][index_36] / Lda_40[index_36][index_36];
         for (int index_32 = 0; index_32 <= Ai_12 - 1; index_32++) Lda_40[index_28][index_32] = Lda_40[index_28][index_32] - Lda_40[index_36][index_32] * Ld_44;
      }
   }
   Ada_16[Ai_12 - 1] = 1;
   Ld_44 = 1;
   for (index_28 = Ai_12 - 2; index_28 >= 0; index_28--) {
      Ada_16[index_28] = 0;
      for (index_32 = index_28; index_32 <= Ai_12 - 1; index_32++) Ada_16[index_28] = Ada_16[index_28] - Lda_40[index_28][index_32] * Ada_16[index_32];
      Ada_16[index_28] = Ada_16[index_28] / Lda_40[index_28][index_28];
      Ld_44 += Ada_16[index_28] * Ada_16[index_28];
   }
   for (index_28 = 0; index_28 <= Ai_12 - 1; index_28++) Ada_16[index_28] = Ada_16[index_28] / MathSqrt(Ld_44);
}

// 30DA4636C2F83FFDF5767D84CF3764ED
double f0_1(double &Ada_0[][], double Ad_4, int Ai_12) {
   double Lda_40[200][200];
   double Ld_44;
   double Lda_52[];
   double Ld_64;
   ArrayResize(Lda_52, Ai_12);
   f0_5(Lda_40, Ada_0);
   for (int index_28 = 0; index_28 <= Ai_12 - 1; index_28++) Lda_40[index_28][index_28] = Lda_40[index_28][index_28] - Ad_4;
   int count_20 = 0;
   for (int index_36 = 0; index_36 <= Ai_12 - 2; index_36++) {
      for (index_28 = index_36 + 1; index_28 <= Ai_12 - 1; index_28++) {
         if (Lda_40[index_36][index_36] == 0.0) {
            for (int index_24 = 0; index_24 <= Ai_12 - 1; index_24++) {
               Lda_52[index_24] = Lda_40[index_24][index_36];
               Lda_40[index_24][index_36] = Lda_40[index_24][index_36 + 1];
               Lda_40[index_24][index_36 + 1] = Lda_52[index_24];
            }
            count_20++;
         }
         Ld_44 = Lda_40[index_28][index_36] / Lda_40[index_36][index_36];
         for (int count_32 = 0; count_32 <= Ai_12 - 1; count_32++) Lda_40[index_28][count_32] = Lda_40[index_28][count_32] - Lda_40[index_36][count_32] * Ld_44;
      }
   }
   int count_16 = 0;
   double Ld_unused_56 = 1;
   for (index_28 = 0; index_28 <= Ai_12 - 1; index_28++) {
      Ld_64 = Lda_40[index_28][index_28];
      if (Ld_64 < 0.0) count_16++;
   }
   return (1.0 * count_16);
}

// F5F286E73BDA105E538310B3190F75C5
void f0_5(double &Ada_0[][], double& Ada_4[][], int Ai_8 = 0) {
   int Li_12 = ArrayRange(Ada_0, 0);
   int Li_16 = ArrayRange(Ada_0, 1);
   for (int index_20 = 0; index_20 < Li_12; index_20++) {
      for (int index_24 = 0; index_24 < Li_16; index_24++) {
         if (Ai_8 != 0) Ada_0[index_20][index_24] = Ada_4[index_24][index_20];
         else Ada_0[index_20][index_24] = Ada_4[index_20][index_24];
      }
   }
}

Recommend