Navigation´╝ÜHome > Content >

ADXPaintedbars_2.mq4

Time: 2017-05-26 | Download file:ADXPaintedbars_2.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : [email protected]
*/
#property copyright "Perky"
#property link      "[email protected]"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 DodgerBlue

extern int ADXPeriod = 3;
double g_ibuf_80[];
double g_ibuf_84[];
int g_ibuf_88[];
int g_ibuf_92[];
double g_ibuf_96[];
double g_iadx_116;
double g_iadx_124;

int init() {
   IndicatorBuffers(5);
   SetIndexBuffer(2, g_ibuf_88);
   SetIndexBuffer(3, g_ibuf_92);
   SetIndexBuffer(4, g_ibuf_96);
   SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS) + 1.0);
   if (!SetIndexBuffer(0, g_ibuf_80) && !SetIndexBuffer(1, g_ibuf_84) && !SetIndexBuffer(2, g_ibuf_88) && !SetIndexBuffer(3, g_ibuf_92) && !SetIndexBuffer(4, g_ibuf_96)) Print("cannot set indicator buffers!");
   return (0);
}

int start() {
   double ld_unused_0 = 0;
   int li_20 = IndicatorCounted();
   if (li_20 < 0) return (-1);
   if (li_20 > 0) li_20--;
   int li_12 = Bars - li_20;
   for (int li_16 = 0; li_16 < li_12; li_16++) {
      g_iadx_116 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_PLUSDI, li_16);
      g_iadx_124 = iADX(NULL, 0, ADXPeriod, PRICE_CLOSE, MODE_MINUSDI, li_16);
      if (g_iadx_124 > g_iadx_116) {
         g_ibuf_84[li_16] = Low[li_16];
         g_ibuf_80[li_16] = High[li_16];
      }
      if (g_iadx_116 > g_iadx_124) {
         g_ibuf_80[li_16] = Low[li_16];
         g_ibuf_84[li_16] = High[li_16];
      }
   }
   return (0);
}

Recommend