Attachments forums

List of attachments posted on this forum.


All files on forums: 135902

Re: ADX DMI Indicators for MT4

RVelasco, Fri Oct 30, 2020 2:36 pm

Sr Mrtools
Do we have a similar version of this that shows the arrow on open candle rather?
No Repainting

Code: Select all

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

extern int ADXbars = 14;
extern int CountBars = 350;
double G_ibuf_84[];
double G_ibuf_88[];
double G_iadx_92;
double G_iadx_100;
double G_iadx_108;
double G_iadx_116;

int init() {
   IndicatorBuffers(2);
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 108);
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 108);
   SetIndexBuffer(0, G_ibuf_84);
   SetIndexBuffer(1, G_ibuf_88);
   return (0);
}

int start() {
   if (CountBars >= Bars) CountBars = Bars;
   SetIndexDrawBegin(0, Bars - CountBars);
   SetIndexDrawBegin(1, Bars - CountBars);
   int ind_counted_8 = IndicatorCounted();
   if (ind_counted_8 < 0) return (-1);
   if (ind_counted_8 < 1) {
      for (int Li_0 = 1; Li_0 <= CountBars; Li_0++) G_ibuf_84[CountBars - Li_0] = 0.0;
      for (Li_0 = 1; Li_0 <= CountBars; Li_0++) G_ibuf_88[CountBars - Li_0] = 0.0;
   }
   for (int Li_4 = CountBars; Li_4 >= 0; Li_4--) {
      G_iadx_92 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, Li_4 - 1);
      G_iadx_100 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_PLUSDI, Li_4);
      G_iadx_108 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, Li_4 - 1);
      G_iadx_116 = iADX(NULL, 0, ADXbars, PRICE_CLOSE, MODE_MINUSDI, Li_4);
      if (G_iadx_92 > G_iadx_108 && G_iadx_100 < G_iadx_116) G_ibuf_84[Li_4] = Low[Li_4] - 5.0 * Point;
      if (G_iadx_92 < G_iadx_108 && G_iadx_100 > G_iadx_116) G_ibuf_88[Li_4] = High[Li_4] + 5.0 * Point;
   }
   return (0);
}

Or would it be possible to create alerts during the candle without repainting?
All files in topic