PDA

View Full Version : PlotStyle.Line Across UnSet Values


whitmark
03-29-2007, 12:46 AM
I am trying to plot a line whereby I set a "valid" value onthe currentbar, then the next three bars, for example, are "invalid" so I do not setvalues to the plot. Thefifth bar is "valid" so I set a value to the plot again. I am finding that the line plot style does not connect theset plot values across the invalid value bars as I would expect it to given how otherplatforms work. Do I correctly understand the line plot functionality in this context? Is there a possible workaround? I am using Version 6.

Regards,

Whitmark

NinjaTrader_Dierk
03-29-2007, 12:52 AM
The problem is that NT only connects valid data points. As there in an invalid plot no line (segment) would be drawn.

a) bar 100 valid, bar 101 invalid, bar 102 valid, bar 103 invalid -> no line segment drawn
b) bar 100 valid, bar 101 valid, bar 102 invalid, bar 103 valid, bar 104 valid -> segments 100-101 and 103-104 drawn

If we changed the logic then there would be no way to render a line with gaps (which is desired behaviour).

whitmark
03-29-2007, 02:05 AM
Dierk Droth wrote: The problem is that NT only connects valid data points. As there in an invalid plot no line (segment) would be drawn.

a) bar 100 valid, bar 101 invalid, bar 102 valid, bar 103 invalid -> no line segment drawn
b) bar 100 valid, bar 101 valid, bar 102 invalid, bar 103 valid, bar 104 valid -> segments 100-101 and 103-104 drawn

If we changed the logic then there would be no way to render a line with gaps (which is desired behaviour).


Thanks Dierk, for the clarification. I could make a case for why you would want to interpolate your line indicator in the event you get an invalid input bar so I would assert thateither method isdesireable. Be that as it may, is there a convenient way to know the x , y coordinate ofa given plot valuesuch that I could use a drawing object to "connect the dots" across invalid (unSet) bars? Thanks!

Regards,

Whitmark

NinjaTrader_Dierk
03-29-2007, 04:39 PM
Hmm not entirely sure what your are looking for, but how about this: You use the DrawLine method in your NinjaScript to draw a line (or a few lines). You should limit the # of lines to a few (if possible), since managing thousands of custom painted lines for sure would have undesirable impact on performance.

whitmark
03-30-2007, 01:14 AM
Thanks Dierk, you make a great point. I'll need to rethink the necessity of that requirement.