Indicator integrate

To add comments, please log in or register
fxnew5
69
fxnew5  

Hello,

I'd like to integrate a custom indicator into an existing MT5 indicator (being used in MT4), it should show an arrow if a certain condition from the (custom) indicator is true.

I set up :

#property indicator_type  DRAW_ARROW 

int Custom_handle; double CustomBuffer[];

and in the OnInit() part:

SetIndexBuffer(1,CustomBuffer,INDICATOR_DATA);

PlotIndexSetInteger(1, PLOT_ARROW, 160);

ArraySetAsSeries(CustomBuffer,true);


and at the very end of the code before      return(rates_total);

to "scan" all the displayed/existing bars

    int s;

  for (s=0; s< rates_total; s++) {if (condition[s]==true) CustomBuffer[s]=Close[0] }   // Close[0] being defined and working btw
 

it doesn't seem to work properly.

So, if anybody has an idea how to correct it, thanks a lot in advance

Mladen Rakic
151626
Mladen Rakic  
fxnew5:

Hello,

I'd like to integrate a custom indicator into an existing MT5 indicator (being used in MT4), it should show an arrow if a certain condition from the (custom) indicator is true.

I set up :

#property indicator_type  DRAW_ARROW 

int Custom_handle; double CustomBuffer[];

and in the OnInit() part:

SetIndexBuffer(1,CustomBuffer,INDICATOR_DATA);

PlotIndexSetInteger(1, PLOT_ARROW, 160);

ArraySetAsSeries(CustomBuffer,true);


and at the very end of the code before      return(rates_total);

to "scan" all the displayed/existing bars

    int s;

  for (s=0; s< rates_total; s++) {if (condition[s]==true) CustomBuffer[s]=Close[0] }   // Close[0] being defined and working btw
 

it doesn't seem to work properly.

So, if anybody has an idea how to correct it, thanks a lot in advance

From that code nobody can tell you what is exactly wrong

To add comments, please log in or register