/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: ht tP: //w ww.m ET A qu oT E S.n Et
   E-mail : Su pP o r T @M eta q u oTeS.Ne t
*/
#property copyright "Aden_ZZ24"
#property link      ""

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow

extern int Candle = 1920;
extern int Length = 24;
double G_ibuf_84[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   SetIndexEmptyValue(2, 0.2);
   SetIndexStyle(0, DRAW_SECTION);
   SetIndexBuffer(0, G_ibuf_84);
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int str2int_40;
   double low_44;
   double high_52;
   double Lda_92[10000][3];
   string Ls_unused_96;
   int ind_counted_8 = IndicatorCounted();
   if (High[1] > High[0]) Comment("SELL !!");
   else
      if (High[1] < High[0]) Comment("BUY !!");
   int Li_20 = 0;
   int Li_16 = 0;
   int index_24 = 0;
   double high_60 = High[Candle];
   double low_68 = Low[Candle];
   int Li_32 = Candle;
   int Li_36 = Candle;
   for (int Li_12 = Candle; Li_12 >= 0; Li_12--) {
      low_44 = 10000000;
      high_52 = -100000000;
      for (int Li_28 = Li_12 + Length; Li_28 >= Li_12 + 1; Li_28--) {
         if (Low[Li_28] < low_44) low_44 = Low[Li_28];
         if (High[Li_28] > high_52) high_52 = High[Li_28];
      }
      if (Low[Li_12] < low_44 && High[Li_12] > high_52) {
         Li_16 = 2;
         if (Li_20 == 1) Li_32 = Li_12 + 1;
         if (Li_20 == -1) Li_36 = Li_12 + 1;
      } else {
         if (Low[Li_12] < low_44) Li_16 = -1;
         if (High[Li_12] > high_52) Li_16 = 1;
      }
      if (Li_16 != Li_20 && Li_20 != 0) {
         if (Li_16 == 2) {
            Li_16 = -Li_20;
            high_60 = High[Li_12];
            low_68 = Low[Li_12];
         }
         index_24++;
         if (Li_16 == 1) {
            Lda_92[index_24][1] = Li_36;
            Lda_92[index_24][2] = low_68;
         }
         if (Li_16 == -1) {
            Lda_92[index_24][1] = Li_32;
            Lda_92[index_24][2] = high_60;
         }
         high_60 = High[Li_12];
         low_68 = Low[Li_12];
      }
      if (Li_16 == 1) {
         if (High[Li_12] >= high_60) {
            high_60 = High[Li_12];
            Li_32 = Li_12;
         }
      }
      if (Li_16 == -1) {
         if (Low[Li_12] <= low_68) {
            low_68 = Low[Li_12];
            Li_36 = Li_12;
         }
      }
      Li_20 = Li_16;
   }
   for (Li_28 = 1; Li_28 <= index_24; Li_28++) {
      str2int_40 = StrToInteger(DoubleToStr(Lda_92[Li_28][1], 0));
      G_ibuf_84[str2int_40] = Lda_92[Li_28][2];
   }
   return (0);
}
