On and Off switch of a line drawing

 

Hi

Can anybody please tell me how to solve tis problem :

I want to draw a line (Buffer[]) on a chart and then switch the drawing off and resume the drawing of the line at a later candle.

Can this be done ?

 
Dirk:

Hi

Can anybody please tell me how to solve tis problem :

I want to draw a line (Buffer[]) on a chart and then switch the drawing off and resume the drawing of the line at a later candle.

Can this be done ?

Set your buffer values to EMPTY_VALUE.
 

angevoyageur:
Set your buffer values to EMPTY_VALUE.

 

If I do that it draws a vertical line down from the Off position to zero and again up from zero to the On position

 
Dirk:

If I do that it draws a vertical line down from the Off position to zero and again up from zero to the On position

Can you show your code, it should work. Have you modified EMPTY_VALUE ?
 

I wrote a small test pgm. The business end of the code look like this.

SetIndexBuffer(0, Buffer0);
SetIndexStyle(0,DRAW_SECTION, STYLE_SOLID, 3, SidewaysColor);

..........

for (j = 100; j > 50; j--)
Buffer0[j] = Array5[j];

for (j = 50; j > 20; j--)
Buffer0[j] = EMPTY_VALUE;

for (j = 20; j >= 0; j--)
Buffer0[j] = Array5[j];

 
Dirk:

I wrote a small test pgm. The business end of the code look like this.

SetIndexBuffer(0, Buffer0);
SetIndexStyle(0,DRAW_SECTION, STYLE_SOLID, 3, SidewaysColor);

..........

for (j = 100; j > 50; j--)
Buffer0[j] = Array5[j];

for (j = 50; j > 20; j--)
Buffer0[j] = EMPTY_VALUE;

for (j = 20; j >= 0; j--)
Buffer0[j] = Array5[j];

 

I figured it out -> change DRAW_SECTION to DRAW_LINE

Thank you very much for your trouble

Reason: