NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 03-29-2007, 12:46 AM   #1
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Post imported post

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
whitmark is offline  
Reply With Quote
Old 03-29-2007, 12:52 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Post imported post

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).
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-29-2007, 02:05 AM   #3
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Post imported post

Dierk Droth wrote:
Quote:
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
whitmark is offline  
Reply With Quote
Old 03-29-2007, 04:39 PM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Post imported post

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.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 03-30-2007, 01:14 AM   #5
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Post imported post

Thanks Dierk, you make a great point. I'll need to rethink the necessity of that requirement.
whitmark is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:39 AM.