Navigation´╝ÜHome > Content >

Uposi.mq4

Time: 2018-01-25 | Download file:Uposi.mq4

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
#property  indicator_width1  2
#property  indicator_width2  2

double g_ibuf_76[];
double g_ibuf_80[];
extern int FasterMode = 1;
extern int FasterMA = 5;//3
extern int SlowerMode = 1;
extern int SlowerMA = 10;//5
double g_time_100;

int init() {
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, g_ibuf_80);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int li_8;
   double l_ima_12;
   double l_ima_20;
   double l_ima_28;
   double l_ima_36;
   double l_ima_44;
   double l_ima_52;
   double ld_60;
   double ld_68;
   int li_76 = IndicatorCounted();
   if (li_76 < 0) return (-1);
   if (li_76 > 0) li_76--;
   int li_0 = Bars - li_76;
   for (int li_4 = 0; li_4 <= li_0; li_4++) {
      li_8 = li_4;
      ld_60 = 0;
      ld_68 = 0;
      for (li_8 = li_4; li_8 <= li_4 + 9; li_8++) ld_68 += MathAbs(High[li_8] - Low[li_8]);
      ld_60 = ld_68 / 10.0;
      l_ima_12 = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, li_4);
      l_ima_28 = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, li_4 + 1);
      l_ima_44 = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, li_4 - 1);
      l_ima_20 = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_CLOSE, li_4);
      l_ima_36 = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_CLOSE, li_4 + 1);
      l_ima_52 = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_CLOSE, li_4 - 1);
      if (l_ima_12 > l_ima_20 && l_ima_28 < l_ima_36 && l_ima_44 > l_ima_52) {
         g_ibuf_76[li_4] = Low[li_4] - ld_60 / 2.0;
         if (g_time_100 != Time[0]) {
           // PlaySound("news.wav");
         }
         g_time_100 = Time[0];
      } else {
         if (l_ima_12 < l_ima_20 && l_ima_28 > l_ima_36 && l_ima_44 < l_ima_52) {
            g_ibuf_80[li_4] = High[li_4] + ld_60 / 2.0;
            if (g_time_100 != Time[0]) {
            //   PlaySound("news.wav");
            }
            g_time_100 = Time[0];
         }
      }
   }
   return (0);
}

Recommend