/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: HTtp:/ /ww w . M E t AQ uoTe s.n eT
   E-mail :  sup poRt@ m Et aqUO t E s. N ET
*/

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

extern int SSP = 7;
extern double Kmax = 50.6;
extern int CountBars = 300;
double G_ibuf_92[];
double G_ibuf_96[];
double G_ibuf_100[];
double G_ibuf_104[];

int init() {
   IndicatorBuffers(4);
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(0, G_ibuf_100);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(1, G_ibuf_104);
   SetIndexBuffer(2, G_ibuf_92);
   SetIndexBuffer(3, G_ibuf_96);
   IndicatorShortName("SS2009_C(" + SSP + ")");
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double Ld_8;
   double Ld_16;
   double Ld_32;
   if (CountBars >= Bars) CountBars = Bars;
   SetIndexDrawBegin(0, Bars - CountBars + SSP);
   SetIndexDrawBegin(1, Bars - CountBars + SSP);
   int ind_counted_4 = IndicatorCounted();
   if (Bars <= SSP + 1) return (0);
   if (ind_counted_4 < SSP + 1) {
      for (int Li_0 = 1; Li_0 <= SSP; Li_0++) G_ibuf_92[CountBars - Li_0] = 0.0;
      for (Li_0 = 1; Li_0 <= SSP; Li_0++) G_ibuf_96[CountBars - Li_0] = 0.0;
   }
   for (Li_0 = CountBars - SSP; Li_0 >= 0; Li_0--) {
      Ld_8 = High[iHighest(NULL, 0, MODE_HIGH, SSP, Li_0 - SSP + 1)];
      Ld_16 = Low[iLowest(NULL, 0, MODE_LOW, SSP, Li_0 - SSP + 1)];
      Ld_32 = Ld_8 - (Ld_8 - Ld_16) * Kmax / 100.0;
      G_ibuf_92[Li_0 - SSP + 6] = Ld_32;
      G_ibuf_96[Li_0 - SSP - 1] = Ld_32;
   }
   for (int Li_40 = CountBars - SSP; Li_40 >= 0; Li_40--) {
      if (G_ibuf_92[Li_40] > G_ibuf_96[Li_40]) {
         G_ibuf_100[Li_40] = 1;
         G_ibuf_104[Li_40] = 0;
      } else {
         G_ibuf_100[Li_40] = 0;
         G_ibuf_104[Li_40] = 1;
      }
   }
   return (0);
}
