![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Oct 2008
Location: Lopez Island Washington
Posts: 47
Thanks: 32
Thanked 0 times in 0 posts
|
I am trying to create a custom 'ZigZag' tool, but when applied to the chart it will only draw the last two lines... how do I get NinjaScript to draw the zigzag lines over the entire range of price data?
I'm using the following code structure...wherein 'flipup' and 'flipdn' represent the bars on which a confirmed trend-change occurs. if(flipdn) { {DrawLine("UpLine",false,CurrentBar-PvtBar[1],PvtPrice[1],PvtHiBarsBack,PivotHigh,Color.Blue,DashStyle.Soli d,2);} } if(flipup) { {DrawLine("DnLine",false,CurrentBar-PvtBar[1],PvtPrice[1],PvtLoBarsBack,PivotLow,Color.Red,DashStyle.Solid, 2);} } |
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
"UpLine" + CurrentBar.ToString()and "DnLine" + CurrentBar.ToString() respectively. |
|
|
|
|
|
The following user says thank you to koganam for this post: |
|
|
|
#3 |
|
Member
Join Date: Oct 2008
Location: Lopez Island Washington
Posts: 47
Thanks: 32
Thanked 0 times in 0 posts
|
Is it possible to declare the color parameter as a variable which could be referenced by input options.
ie: private Color UpColor =Color.Blue; private Color trendcolor; if (something){trendcolor=UpColor;} DrawLine(.........,trendcolor,2); |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Hawk Arps,
Yes, this is possible. Please see this forum post which explains the approach: http://www.ninjatrader.com/support/f...ead.php?t=4977
Ryan M
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_RyanM for this post: |
|
![]() |
| Tags |
| drawline, plots |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| zigzag | mullum | Automated Trading | 10 | 06-17-2011 12:12 AM |
| ZigZag Help | GreenTrade | Indicator Development | 7 | 05-27-2011 05:42 AM |
| ZigZag on last bar | ssierra | NinjaScript File Sharing Discussion | 3 | 02-02-2008 01:33 AM |
| ZigZag with labels | dkelly | NinjaScript File Sharing Discussion | 3 | 01-25-2008 11:03 AM |
| ZigZag indicator... | funk101 | Miscellaneous Support | 2 | 11-24-2007 06:53 PM |