DRAW_SECTION but with spaces

 

How can I draw lines using buffers in an EA to produce the following effect? Using one buffer with DRAW_SECTION makes one continuous line, I want it broken up into segments like this -

 

 Thanks in advance! 

 
You'll have to use DRAW_LINE and linear interpolate buffer elements between the two end points.
Not compiled, not tested.
void draw_segment(double& buffer[], double vLast, int iLast, double vBeg, int iBeg){
   for(int iBar = iLast; iBar >= iBeg; --iBar)
      buffer[iBar] = vBeg + (vLast-vBeg) * (iBar-iBeg) / (iLast-iBeg);
}
Not compiled, not tested.
 
ggladden:

How can I draw lines using buffers in an EA to produce the following effect? Using one buffer with DRAW_SECTION makes one continuous line, I want it broken up into segments like this -

Try to place EMPTY_VALUE inbetween of visible sections.
 
ggladden:

How can I draw lines using buffers in an EA to produce the following effect? Using one buffer with DRAW_SECTION makes one continuous line, I want it broken up into segments like this

Stanislav Korotky:
Try to place EMPTY_VALUE inbetween of visible sections.

Cannot be done with DRAW_SECTION.

WHRoeder proposed a solution, there are others.