![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Apr 2010
Location: San Antonio, Texas
Posts: 315
Thanks: 31
Thanked 2 times in 2 posts
|
I have a strategy that has a price modification feature for the StopLoss and I would like to have a horizontal line plotted at the stop level and updated as the stop changes. (only a single line at any one time that is at the latest stop level, not multiple lines) How would that be done? Thanks.
Last edited by billr; 08-09-2010 at 01:01 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello billr,
Your StopLoss can use a variable for its level. Your line can also use a variable. If you use the same variable name for each then it's drawn at the same level. Below are links to method signatures for stop losses and horizontal lines. http://www.ninjatrader-support.com/H...ontalLine.html http://www.ninjatrader-support.com/H...tStopLoss.html Set the Y value for the horizontal line to the same value as your stop loss. If you're not using mode price for your stop loss than you'll have to calculate these values manually. Place the DrawHorizontal line in the same block that places your entry orders. You can see this reference sample for help with monitoring stop loss and target orders: http://www.ninjatrader.com/support/f...ead.php?t=5790 You could then monitor for when status is filled and then use RemoveDrawObject() to remove your line.
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| plot dash line | velocity | General Programming | 3 | 12-17-2009 07:22 AM |
| Trying to Plot Line in Strategy | yamdigger | Strategy Development | 2 | 05-27-2009 11:17 AM |
| Plot horizontal line | ssg10 | General Programming | 1 | 05-13-2009 05:54 AM |
| Line Plot | velocity | General Programming | 10 | 05-07-2009 05:59 AM |
| Plot Line Length | ozfader | General Programming | 3 | 07-12-2008 11:39 PM |