![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2008
Posts: 185
Thanks: 20
Thanked 2 times in 2 posts
|
Hello,
The attached sketch shows lines I've drawn using the following simple code: Code:
if (!newblueline && GoodDirection[0] == 1 && GoodDirection[1] != 1)
{
newblueline = true;
newredline = false;
barcountstart = CurrentBar;
startline = Close[0];
}
if (newblueline && GoodDirection[0] != 1 && GoodDirection[1] == 1)
{
barcountend = CurrentBar;
endline = Close[0];
//newblueline = false;
}
if (!newredline && GoodDirection[0] == -1 && GoodDirection[1] != -1)
{
newredline = true;
newblueline = false;
barcountstart = CurrentBar;
startline = Close[0];
}
if (newredline && GoodDirection[0] != -1 && GoodDirection[1] == -1)
{
barcountend = CurrentBar;
endline = Close[0];
//newredline = false;
}
if (newblueline) DrawLine("newlineblue"+CurrentBar,true,(CurrentBar - barcountstart),startline,(CurrentBar - barcountend), endline, Color.Blue,DashStyle.DashDot,3);
if (newredline) DrawLine("newlinered"+CurrentBar,true,(CurrentBar - barcountstart),startline,(CurrentBar - barcountend), endline, Color.Red,DashStyle.DashDot,3);
http://screencast.com/t/Dxt256mz Please advise what needs to change with the code to plot one red line in the orchid/purple zone, one blue line in the blue zone, and no plots in the blank zone. Thanks. Kirk
Last edited by zeller4; 12-26-2011 at 08:24 AM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
|
Hello,
Thanks for the note. Although I cannot offer exact code you would need to change to do this I can point you in the right direction to do this on your own. It appears you are using DrawLine() to do this therefor you needed to add code so that you do not start Drawing a Line during this time or that and existing line does not have a start time before the time and an end time after the time. Since you defint the start point and end points of each line you draw you would need to make this change in your code you use to decide to DrawLine() or not to DrawLine(). Let me know if I can be of further assistance.
Brett
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plotting Lines at nearest 1/8 centries | cbart_1 | Indicator Development | 18 | 09-26-2011 10:51 AM |
| plotting lines in a strategy | kjackson | Strategy Development | 1 | 03-21-2010 07:43 PM |
| Plotting My Own Lines | cbart_1 | Indicator Development | 8 | 08-12-2009 01:19 PM |
| Plotting different lines in different panels | zenith1107 | General Programming | 1 | 05-13-2009 06:33 AM |
| Bars and Lines not Plotting | RandyT | General Programming | 4 | 10-09-2008 09:25 AM |