Navigation´╝ÜHome > Content >

5_day_breakout_(2).mq4

Time: 2010-10-18 | Download file:5_day_breakout_(2).mq4

#property copyright "Bill Sica"
#property link      "http://www.tetsuyama.com"

#property indicator_chart_window

extern int DAYS = 5;

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   double Lda_0[20];
   double Lda_4[20];
   int Li_32 = 1;
   ArrayResize(Lda_0, DAYS);
   ArrayResize(Lda_4, DAYS);
   ArrayInitialize(Lda_0, 0);
   ArrayInitialize(Lda_4, 0);
   ArrayCopySeries(Lda_4, 1, Symbol(), PERIOD_D1);
   ArrayCopySeries(Lda_0, 2, Symbol(), PERIOD_D1);
   double price_24 = Lda_4[1];
   double price_16 = Lda_0[1];
   for (Li_32 = 1; Li_32 < DAYS; Li_32++)
      if (price_24 > Lda_4[Li_32]) price_24 = Lda_4[Li_32];
   for (Li_32 = 1; Li_32 < DAYS; Li_32++)
      if (price_16 < Lda_0[Li_32]) price_16 = Lda_0[Li_32];
   Comment("\n5dayH ", price_16, 
   "\n5dayL ", price_24);
   ObjectDelete("5dayHigh");
   ObjectDelete("5dayLow");
   ObjectCreate("5dayHigh", OBJ_HLINE, 0, TimeCurrent(), price_16);
   ObjectSet("5dayHigh", OBJPROP_COLOR, Yellow);
   ObjectSet("5dayHigh", OBJPROP_STYLE, STYLE_SOLID);
   ObjectCreate("5dayLow", OBJ_HLINE, 0, TimeCurrent(), price_24);
   ObjectSet("5dayLow", OBJPROP_COLOR, Yellow);
   ObjectSet("5dayLow", OBJPROP_STYLE, STYLE_SOLID);
   WindowRedraw();
   return (0);
}

Recommend