Stop - Start Drawing of Custom Indicator Line?

 

Hi


In a custom indicator, I'd like to turn the line drawing off and on within the line, but I can't figure out how to do it.


I have a pivot point custom indicator and I would really like to not draw the transitions between the levels when they change. It would be ideal to draw each level, but turn it off when the level changed, then turn it back on again for the new level.


I've tried:

(a) SetIndexStyle( 0, DRAW_NONE); followed by SetIndexStyle( 0, DRAW_LINE, STYLE-DOT, 1); Didn't work.

(b) SetIndexEmptyValue( 0, 0.0 ); Can't work out what it does.


Any suggestions would be great.


Jellybean

 

Use DRAW_SECTION in SetIndexStyle()

Line segments are drawn between values, if the value is EMPTY_VALUE no line segment is drawn

 
phy:

Use DRAW_SECTION in SetIndexStyle()

Line segments are drawn between values, if the value is EMPTY_VALUE no line segment is drawn

Thanks for your suggestion, phy.


I tried it, but all it did was draw from the values adjacent to the empty value, so I still get the transitions.

However, I figured out that if I use DRAW_ARROW and choose a symbol that looks like a point I get the effect I want. I just need to remember that the symbol appears a little high because its reference point is at the bottom of the symbol.


Thanks again.


Jellybean

 

My mistake...

DRAW_LINE will not draw from a bar with a value in the index to a bar with EMPTY_VALUE in the index.

In this case, value of 0 is not drawn.

DRAW_SECTION, on the other hand, draws a line from last valid value to next valid value, as in ZIG ZAG, where you may have only
a few data points that you want to connect... draw low, later connect that low to high, etc.

 

Thanks for this, phy :-)

I also had something else wrong in my logic, but that's sorted, and the indicator looks great.

Cheers

Jellybean

Reason: