![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
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++;
}
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Dec 2007
Posts: 314
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the suggestion
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |