Navigation´╝ÜHome > Content >

indicator01.mq4

Time: 2015-07-27 | Download file:indicator01.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Lime

extern double Step = 0.02;
extern double Maximum = 0.2;
double g_ibuf_92[];
int gi_96;
int gi_100;
double gd_104;
double gd_112;
double gd_120;
double gd_128;
double gd_136;
bool gi_144 = TRUE;

int init() {
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 159);
   SetIndexBuffer(0, g_ibuf_92);
   return (0);
}

void SaveLastReverse(int ai_0, int ai_4, double ad_8, double ad_16, double ad_24, double ad_32, double ad_40) {
   gi_96 = ai_0;
   gi_100 = ai_4;
   gd_104 = ad_8;
   gd_120 = ad_16;
   gd_112 = ad_24;
   gd_128 = ad_32;
   gd_136 = ad_40;
}

int start() {
   bool li_0;
   double ld_4;
   double l_high_12;
   double l_low_20;
   double ld_28;
   double ld_36;
   double l_low_44;
   double l_high_52;
   double ld_60;
   int l_ind_counted_72 = IndicatorCounted();
   if (Bars < 3) return (0);
   int li_68 = Bars - 2;
   if (l_ind_counted_72 == 0 || gi_144) {
      gi_144 = FALSE;
      li_0 = TRUE;
      ld_4 = Step;
      l_high_12 = -10000000.0;
      l_low_20 = 10000000.0;
      while (li_68 > 0) {
         gi_96 = li_68;
         l_low_44 = Low[li_68];
         if (l_low_20 > l_low_44) l_low_20 = l_low_44;
         l_high_52 = High[li_68];
         if (l_high_12 < l_high_52) l_high_12 = l_high_52;
         if (l_high_52 > High[li_68 + 1] && l_low_44 > Low[li_68 + 1]) break;
         if (l_high_52 < High[li_68 + 1] && l_low_44 < Low[li_68 + 1]) {
            li_0 = FALSE;
            break;
         }
         li_68--;
      }
      for (int li_76 = li_68; li_76 < Bars; li_76++) g_ibuf_92[li_76] = 0.0;
      if (li_0) {
         g_ibuf_92[li_68] = Low[li_68 + 1];
         ld_28 = High[li_68];
      } else {
         g_ibuf_92[li_68] = High[li_68 + 1];
         ld_28 = Low[li_68];
      }
      li_68--;
   } else {
      li_68 = gi_96;
      ld_4 = gd_104;
      li_0 = gi_100;
      l_high_12 = gd_112;
      l_low_20 = gd_120;
      ld_28 = gd_128;
      ld_36 = gd_136;
   }
   while (li_68 >= 0) {
      l_low_44 = Low[li_68];
      l_high_52 = High[li_68];
      if (li_0 && l_low_44 < g_ibuf_92[li_68 + 1]) {
         SaveLastReverse(li_68, 1, ld_4, l_low_44, l_high_12, ld_28, ld_36);
         ld_4 = Step;
         li_0 = FALSE;
         ld_28 = l_low_44;
         l_low_20 = l_low_44;
         g_ibuf_92[li_68] = l_high_12;
         li_68--;
         continue;
      }
      if (!li_0 && l_high_52 > g_ibuf_92[li_68 + 1]) {
         SaveLastReverse(li_68, 0, ld_4, l_low_20, l_high_52, ld_28, ld_36);
         ld_4 = Step;
         li_0 = TRUE;
         ld_28 = l_high_52;
         l_high_12 = l_high_52;
         g_ibuf_92[li_68] = l_low_20;
         li_68--;
         continue;
      }
      ld_60 = g_ibuf_92[li_68 + 1];
      ld_36 = ld_60 + ld_4 * (ld_28 - ld_60);
      if (li_0) {
         if (ld_28 < l_high_52 && ld_4 + Step <= Maximum) ld_4 += Step;
         if (l_high_52 < High[li_68 + 1] && li_68 == Bars - 2) ld_36 = g_ibuf_92[li_68 + 1];
         ld_60 = Low[li_68 + 1];
         if (ld_36 > ld_60) ld_36 = ld_60;
         ld_60 = Low[li_68 + 2];
         if (ld_36 > ld_60) ld_36 = ld_60;
         if (ld_36 > l_low_44) {
            SaveLastReverse(li_68, 1, ld_4, l_low_44, l_high_12, ld_28, ld_36);
            ld_4 = Step;
            li_0 = FALSE;
            ld_28 = l_low_44;
            l_low_20 = l_low_44;
            g_ibuf_92[li_68] = l_high_12;
            li_68--;
            continue;
         }
         if (ld_28 < l_high_52) {
            l_high_12 = l_high_52;
            ld_28 = l_high_52;
         }
      } else {
         if (ld_28 > l_low_44 && ld_4 + Step <= Maximum) ld_4 += Step;
         if (l_low_44 < Low[li_68 + 1] && li_68 == Bars - 2) ld_36 = g_ibuf_92[li_68 + 1];
         ld_60 = High[li_68 + 1];
         if (ld_36 < ld_60) ld_36 = ld_60;
         ld_60 = High[li_68 + 2];
         if (ld_36 < ld_60) ld_36 = ld_60;
         if (ld_36 < l_high_52) {
            SaveLastReverse(li_68, 0, ld_4, l_low_20, l_high_52, ld_28, ld_36);
            ld_4 = Step;
            li_0 = TRUE;
            ld_28 = l_high_52;
            l_high_12 = l_high_52;
            g_ibuf_92[li_68] = l_low_20;
            li_68--;
            continue;
         }
         if (ld_28 > l_low_44) {
            l_low_20 = l_low_44;
            ld_28 = l_low_44;
         }
      }
      g_ibuf_92[li_68] = ld_36;
      li_68--;
   }
   return (0);
}

Recommend