![]() |
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 |
|
Junior Member
Join Date: Sep 2010
Location: London, UK
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
|
Can someone please explain exactly how the percentage offset is calculated in this case?
Will the stop trail the market price by % specified? If so, as market price increases then will the difference between stop and market increase? (e.g. a 1% stop from $5 is 5c, price eventually increases to $5.50 so stop trails behind by 5.5c) Or is the inital stop created % away from entry price then tracks market price by that fixed amount? (e.g. 1% stop on $5 is 5c, price eventually increases to $5.50 but stop trails by 5c) Also, if I want to dynamically adjust the trail do I have to give the order a unique name so NT knows which one I am referring to? Is this even possible? Thanks! |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hello BillyRayValentine,
Yes, this is how it works. It trails the last traded price by the specified percentage. As the market increases in your favor, the stop will also adjust. You can dynamicaly adjust stops and targets. This reference sample helps with this: Modifying the price of stop loss and profit target orders
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2010
Location: London, UK
Posts: 18
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Ryan
With the Price option for setting stop price, can I pass in a variable or does a number (double) have to be implicitly specified? E.g can I pass into the SetTrailStop() command a variable which stores a stop value I am calculating elsewhere in my code? Thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Yes, you can use a variable for your stop price.
However, CalculationMode.Price doesn't make sense in terms of a trail stop, so you would want to use SetStopLoss() and specify your price with this method.
Ryan M
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| commision as a percentage | calin | Miscellaneous Support | 1 | 04-07-2010 06:30 AM |
| Investing a percentage of the whole account | MasterSepp | General Programming | 8 | 10-01-2009 10:12 AM |
| Account Performance Percentage | DangerBoy | Miscellaneous Support | 1 | 10-01-2009 04:54 AM |
| A percentage of a move | stephenszpak | Suggestions And Feedback | 8 | 05-06-2009 08:18 AM |
| Percentage Change in MA | Emil Zola | Market Analyzer | 1 | 05-10-2007 12:35 PM |