Download MetaTrader 5

How can you use an array to draw a discontinuous indicator, maybe with NULL values?

To add comments, please log in or register
Jordi Bassaganas
3573
Jordi Bassaganas  

Hi there,

I'd like to plot a discontinuous indicator which is defined only in some intervals.

My indicator only has one buffer:

SetIndexBuffer(0,myOnlyBuffer,INDICATOR_DATA);

I am assuming that it is possible to assign NULL in some positions of myOnlyBuffer (if you assign NaN values to arrays in GNU/Octave then they are not plotted) in order for MT5 to ignore those points later, when plotting the indicator. However those points are plotted and the indicator doesn't look very good in the empty intervals.

How can you define arrays in order to plot discontinous indicators? Is this approach ok?

Thks in advance for your tips

Alain Verleyen
Moderator
29875
Alain Verleyen  
laplacianlab:

Hi there,

I'd like to plot a discontinuous indicator which is defined only in some intervals.

My indicator only has one buffer:

I am assuming that it is possible to assign NULL in some positions of myOnlyBuffer (if you assign NaN values to arrays in GNU/Octave then they are not plotted) in order for MT5 to ignore those points later, when plotting the indicator. However those points are plotted and the indicator doesn't look very good in the empty intervals.

How can you define arrays in order to plot discontinous indicators? Is this approach ok?

Thks in advance for your tips

Already asked and answered ;-)


myOnlyBuffer[i] = EMPTY_VALUE;
Jordi Bassaganas
3573
Jordi Bassaganas  
angevoyageur:
Already asked and answered ;-)


That was great (and a bit difficult to find..) Thks!
To add comments, please log in or register