Navigation:Home > Content >

123ForexPatterns.mq4

Time: 2012-12-02 | Download file:123ForexPatterns.mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: HtTP ://w wW. meT a q u Otes .NE t
   E-mail :  s uppo R T@ Me t a Q UO Te s .NE T
*/
#property copyright "Copyright © 2011 Robert Dee"
#property link      "www.forexfactory.com/robdee"

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 DodgerBlue
#property indicator_color2 OrangeRed
#property indicator_color3 DodgerBlue
#property indicator_color4 OrangeRed
#property indicator_color5 DodgerBlue
#property indicator_color6 OrangeRed

extern string Notes = "BETA TEST EURUSD M5 Setup";
extern bool ShowBears = TRUE;
extern bool ShowBulls = TRUE;
extern bool ShowStatus = TRUE;
extern bool ShowDots = FALSE;
extern bool VolFilter = TRUE;
extern int VolMaFast = 12;
extern int VolMaSlow = 144;
bool Gi_unused_112 = FALSE;
int G_period_116 = 144;
bool Gi_120 = FALSE;
double G_ibuf_124[];
double G_ibuf_128[];
double G_ibuf_132[];
double G_ibuf_136[];
double G_ibuf_140[];
double G_ibuf_144[];
int Gi_148;
int Gi_152;
datetime G_time_156;
datetime G_time_160;
datetime G_time_164;
double Gd_168;
double G_high_176;
double G_low_184;
double Gd_unused_192;
double Gd_unused_200;
double Gd_208;
double Gd_216;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexStyle(2, DRAW_HISTOGRAM);
   SetIndexStyle(3, DRAW_HISTOGRAM);
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexArrow(4, 159);
   SetIndexStyle(5, DRAW_ARROW);
   SetIndexArrow(5, 159);
   SetIndexBuffer(0, G_ibuf_124);
   SetIndexBuffer(1, G_ibuf_128);
   SetIndexBuffer(2, G_ibuf_132);
   SetIndexBuffer(3, G_ibuf_136);
   SetIndexBuffer(4, G_ibuf_140);
   SetIndexBuffer(5, G_ibuf_144);
   SetIndexEmptyValue(0, EMPTY_VALUE);
   SetIndexEmptyValue(1, EMPTY_VALUE);
   SetIndexEmptyValue(2, EMPTY_VALUE);
   SetIndexEmptyValue(3, EMPTY_VALUE);
   SetIndexEmptyValue(4, EMPTY_VALUE);
   SetIndexEmptyValue(5, EMPTY_VALUE);
   SetIndexLabel(0, "BuyLine");
   SetIndexLabel(1, "SellLine");
   SetIndexLabel(2, "");
   SetIndexLabel(3, "");
   SetIndexLabel(4, "");
   SetIndexLabel(5, "");
   IndicatorShortName("123PatternsV7 BETA");
   IndicatorDigits(Digits);
   if (IsTesting() == FALSE) {
      Print("Copyright © 2011 Robert Dee, All Rights Reserved");
      Print("Free software for personal non-commercial use only. No guarantees are expressed or implied.");
      Print("123PatternsV7 BETA" + " indicator version " + 20111214 + " for " + "Public BETA" + " release, compiled with MetaTrader4 Build " + 409);
   }
   return (0);
}

// 0165A52BA552B8BC54D084009B79F18B
void f0_0() {
   double Ld_0;
   double Ld_8;
   double Ld_16;
   double ihigh_24;
   double ilow_32;
   double iatr_40;
   double Ld_48;
   double Ld_56;
   double Ld_64;
   string Ls_72;
   if (IsTesting() != TRUE) {
      if (ShowStatus != FALSE) {
         Ld_16 = MathPow(10, Digits - 1);
         ihigh_24 = iHigh(NULL, PERIOD_D1, 0);
         ilow_32 = iLow(NULL, PERIOD_D1, 0);
         iatr_40 = iATR(NULL, PERIOD_D1, 20, 1);
         Ld_48 = ihigh_24 - ilow_32;
         Ld_56 = Ld_48 / iatr_40;
         Ld_64 = MathMax(Volume[1], Volume[0]) / Gd_216;
         Ls_72 = "123PatternsV7 BETA" + "  " + TimeToStr(TimeCurrent(), TIME_MINUTES) + "  ";
         if (Gd_168 == G_ibuf_124[0]) {
            Ls_72 = Ls_72 + "BUY " + TimeToStr(Gi_152, TIME_MINUTES) + " " + DoubleToStr(Gd_168, Digits) + " ";
            Ld_0 = High[iHighest(NULL, 0, MODE_HIGH, iBarShift(NULL, 0, Gi_152) + 1, 0)] - Gd_168;
            Ld_8 = Gd_168 - Low[iLowest(NULL, 0, MODE_LOW, iBarShift(NULL, 0, Gi_152) + 1, 0)];
            Ls_72 = Ls_72 + "+" + DoubleToStr(Ld_0 * Ld_16, 1) + " -" + DoubleToStr(Ld_8 * Ld_16, 1) + "  ";
         }
         if (Gd_168 == G_ibuf_128[0]) {
            Ls_72 = Ls_72 + "SELL " + TimeToStr(Gi_152, TIME_MINUTES) + " " + DoubleToStr(Gd_168, Digits) + " ";
            Ld_0 = Gd_168 - Low[iLowest(NULL, 0, MODE_LOW, iBarShift(NULL, 0, Gi_152) + 1, 0)];
            Ld_8 = High[iHighest(NULL, 0, MODE_HIGH, iBarShift(NULL, 0, Gi_152) + 1, 0)] - Gd_168;
            Ls_72 = Ls_72 + "+" + DoubleToStr(Ld_0 * Ld_16, 1) + " -" + DoubleToStr(Ld_8 * Ld_16, 1) + "  ";
         }
         Ls_72 = Ls_72 + "DR=" + DoubleToStr(Ld_48 * Ld_16, 1) + "  ";
         Ls_72 = Ls_72 + "ADR=" + DoubleToStr(iatr_40 * Ld_16, 1) + "  ";
         Ls_72 = Ls_72 + "Ratio=" + DoubleToStr(Ld_56, 2) + "  ";
         Ls_72 = Ls_72 + "Vol=" + DoubleToStr(Ld_64, 2) + "  ";
         Ls_72 = Ls_72 + "Spread=" + DoubleToStr((Ask - Bid) * Ld_16, 1) + "  ";
         Comment(Ls_72);
      }
   }
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int Li_0;
   double Ld_4;
   double Ld_12;
   double Ld_20;
   double Ld_28;
   double Ld_36;
   double Ld_44;
   double Lda_52[100];
   double icci_56;
   if (G_time_156 == Time[1]) Li_0 = 0;
   else {
      if (VolFilter == TRUE) {
         ArrayResize(Lda_52, Bars);
         ArrayInitialize(Lda_52, EMPTY_VALUE);
         ArraySetAsSeries(Lda_52, TRUE);
         for (Li_0 = Bars - 1; Li_0 >= 0; Li_0--) Lda_52[Li_0] = Volume[Li_0];
      }
      Li_0 = Bars - 1;
      G_time_156 = Time[1];
   }
   while (Li_0 >= 0) {
      if (VolFilter == TRUE) {
         Gd_208 = NormalizeDouble(iMAOnArray(Lda_52, 0, VolMaFast, 0, MODE_SMA, Li_0 + 1), 0);
         Gd_216 = NormalizeDouble(iMAOnArray(Lda_52, 0, VolMaSlow, 0, MODE_SMA, Li_0 + 1), 0);
      }
      if (iHighest(NULL, 0, MODE_HIGH, 5, Li_0) == Li_0 + 1) {
         Gd_unused_192 = G_high_176;
         G_high_176 = High[Li_0 + 1];
         G_time_160 = Time[Li_0 + 1];
         Gi_148 = 0;
      }
      if (iLowest(NULL, 0, MODE_LOW, 5, Li_0) == Li_0 + 1) {
         Gd_unused_200 = G_low_184;
         G_low_184 = Low[Li_0 + 1];
         G_time_164 = Time[Li_0 + 1];
         Gi_148 = 0;
      }
      Ld_4 = High[Li_0 + 1] - (Low[Li_0 + 1]);
      Ld_12 = (High[Li_0 + 1] + (Low[Li_0 + 1])) / 2.0;
      Ld_20 = Low[Li_0 + 1] + Ld_4 / 3.0;
      Ld_28 = High[Li_0 + 1] - Ld_4 / 3.0;
      Ld_36 = Low[Li_0 + 1] + Ld_4 / 6.0;
      Ld_44 = High[Li_0 + 1] - Ld_4 / 6.0;
      if (ShowDots == TRUE) {
         G_ibuf_140[Li_0 + 1] = EMPTY_VALUE;
         G_ibuf_144[Li_0 + 1] = EMPTY_VALUE;
         G_ibuf_144[iBarShift(NULL, 0, G_time_160)] = G_high_176 + 10.0 * Point;
         G_ibuf_140[iBarShift(NULL, 0, G_time_164)] = G_low_184 - 10.0 * Point;
      }
      if (ShowBears == TRUE) {
         if (Gi_148 != 20) {
            if (Low[Li_0] < Low[Li_0 + 1] - 5.0 * Point) {
               if (G_time_160 > Time[Li_0 + 8]) {
                  if (VolFilter == FALSE || Gd_208 > 1.09 * Gd_216) {
                     if (VolFilter == FALSE || Volume[Li_0 + 1] > Gd_216) {
                        if (VolFilter == FALSE || Volume[Li_0 + 1] > Volume[Li_0 + 2]) {
                           if (Open[Li_0 + 1] > Ld_20 && Close[Li_0 + 1] < Open[Li_0 + 1]) {
                              if (Close[Li_0 + 1] < Ld_36 || Close[Li_0 + 1] < G_low_184) {
                                 G_ibuf_136[Li_0 + 1] = Open[Li_0 + 1];
                                 G_ibuf_132[Li_0 + 1] = Close[Li_0 + 1];
                                 G_ibuf_128[Li_0 + 1] = Close[Li_0 + 1];
                                 G_ibuf_128[Li_0 + 2] = EMPTY_VALUE;
                                 G_ibuf_124[Li_0 + 1] = Open[Li_0 + 1];
                                 G_ibuf_124[Li_0 + 2] = EMPTY_VALUE;
                                 Gi_148 = 20;
                                 Gd_168 = G_ibuf_128[Li_0 + 1];
                                 Gi_152 = Time[Li_0];
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      if (ShowBulls == TRUE) {
         if (Gi_148 != 10) {
            if (High[Li_0] > High[Li_0 + 1] + 5.0 * Point) {
               if (High[Li_0 + 1] > High[Li_0 + 2] + 5.0 * Point) {
                  if (G_time_164 > Time[Li_0 + 6]) {
                     if (VolFilter == FALSE || Gd_208 > 1.09 * Gd_216) {
                        if (VolFilter == FALSE || Volume[Li_0 + 1] > Gd_216) {
                           if (Open[Li_0 + 1] < Ld_12 && Close[Li_0 + 1] > Open[Li_0 + 1]) {
                              if (Close[Li_0 + 1] > Ld_44 || Close[Li_0 + 1] > G_high_176) {
                                 G_ibuf_136[Li_0 + 1] = Open[Li_0 + 1];
                                 G_ibuf_132[Li_0 + 1] = Close[Li_0 + 1];
                                 G_ibuf_124[Li_0 + 1] = Close[Li_0 + 1];
                                 G_ibuf_124[Li_0 + 2] = EMPTY_VALUE;
                                 G_ibuf_128[Li_0 + 1] = Open[Li_0 + 1];
                                 G_ibuf_128[Li_0 + 2] = EMPTY_VALUE;
                                 Gi_148 = 10;
                                 Gd_168 = G_ibuf_124[Li_0 + 1];
                                 Gi_152 = Time[Li_0];
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
      }
      G_ibuf_128[Li_0] = G_ibuf_128[Li_0 + 1];
      G_ibuf_124[Li_0] = G_ibuf_124[Li_0 + 1];
      if (Gi_120 == TRUE) {
         icci_56 = iCCI(NULL, 0, G_period_116, PRICE_CLOSE, Li_0 + 1);
         if (icci_56 < 0.0 && icci_56 > -125.0) {
            if (G_time_164 < Time[Li_0 + 1]) {
               if (G_time_164 > Time[Li_0 + 6]) {
                  if (Open[Li_0 + 1] < Ld_20) {
                     if (Close[Li_0 + 1] > Ld_28) {
                        G_ibuf_136[Li_0 + 1] = Open[Li_0 + 1];
                        G_ibuf_132[Li_0 + 1] = Close[Li_0 + 1];
                     }
                  }
               }
            }
         }
      }
      Li_0--;
   }
   f0_0();
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   for (int index_0 = 0; index_0 < Bars; index_0++) {
      G_ibuf_124[index_0] = EMPTY_VALUE;
      G_ibuf_128[index_0] = EMPTY_VALUE;
      G_ibuf_132[index_0] = EMPTY_VALUE;
      G_ibuf_136[index_0] = EMPTY_VALUE;
      G_ibuf_140[index_0] = EMPTY_VALUE;
      G_ibuf_144[index_0] = EMPTY_VALUE;
   }
   Comment("");
   return (0);
}

Recommend