NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 06-28-2008, 10:46 AM   #1
velocity
Senior Member
 
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
Default Extending a Line forward

I am trying to get NT to extend a line on the high of a current bar to go 3 bars to the right at the same price. My code is

DrawLine("MyLine"+CurrentBar, 1, High[0], 0, High[0], Color.Blue, DashStyle.Dot, 4);

This will only draw a line on the current bar and not the future 3 bars at the same price.

Any thoughts on how to do this?

thanks

Steve
velocity is offline  
Reply With Quote
Old 06-28-2008, 12:17 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Future bar drawing is currently not available in the sense that you cannot draw a line to fill the place of where the future bars will be plotted into.

What you can do is plot the line for the next 3 bars as the bars become populated though. To achieve this you will need to determine the condition in which you want to draw the line then set a switch that will be active for 3 bars and inside that switch you will draw the line, each time modifying the startBars parameter to match the latest bar.

Here is some untested code
Code:
if (Close[0] > Open[0])
     drawLineSet = 1;
while (drawLineSet <= 3)
{
     DrawLine("MyLine", drawLineSet, High[drawLineSet - 1], drawLineSet - 1, High[drawLineSet - 1], Color.Blue, DashStyle.Dot, 4);
     drawLineSet++;
}
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-28-2008, 12:37 PM   #3
velocity
Senior Member
 
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks for the suggestion
velocity 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to draw a parallel line to a trend line? tradewiz Charting 4 12-19-2007 04:42 AM
Walk Forward Optimization JonesWooHoo Suggestions And Feedback 8 10-12-2007 04:16 AM
Forward Alerts via e-mail vlc Miscellaneous Support 1 08-15-2007 04:10 AM
Walk Forward within the strategy lyes Strategy Analyzer 2 04-30-2007 07:55 AM
Extending drawn lines LG Charting 9 04-22-2007 09:32 PM


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