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

 

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

 
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;
 
angevoyageur:
Already asked and answered ;-)


That was great (and a bit difficult to find..) Thks!
Reason: