![]() |
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 |
|
Certified NinjaScript Consultant
|
Is there a way for me to GET the prevailing stop price used by the SetTrailStop method such that I can track the value at the close of each bar for debugging purposes? I am setting an initial trailing stop using CalculationMode.Ticks in Initialize() and when Flat but when in an open position, will reduce the amount of the trailing stop within OnBarUpdate() when a certain profit objective is met. It does not appear that the subsequent ratcheted trailing stop is working correctly. Thanks.
Whitmark |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Unfortunately not at this time. Possibly in the fall since we are introducing some new concepts that allow you to get back order information.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Certified NinjaScript Consultant
|
The help on SetTrailStop() states:
Quote:
SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool simulated)If there is an issue, is there a recommended work around? Also, in this context, CalculationModes of "Percent" and "Ticks" make sense as a trailing stop offset, but how is the mode "Price" used? Thanks, Whitmark
Last edited by whitmark; 06-16-2007 at 11:33 AM.
|
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
All parameters are required and the method only needs to be called once, not each bar. Price is used as an absolute value. If you passed in "2" and you were trading MSFT, that would be $2 offset which is the same as a 200 tick offset.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Certified NinjaScript Consultant
|
The help shows multiple syntax versions so its helpful to know when to use appropriate one. I've noticed the wizard uses the last one.
Quote:
I am not aware of any restrictions regarding the concurrent use of StopLoss() and SetTrailStop(), and there are certainly instances where you would want to manage the two differently, particularly in a dynamic manner. Please advise. Thanks, Whitmark |
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
The first called likely will take precedence if the fromEntrySignal name is the same...both will not operate simultaneously on the same signal name. If they are different, then they will operate independantly.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Certified NinjaScript Consultant
|
Thanks Ray,
Are you stating that if you place an order in a strategy (regardless if whether you specify it with a fromEntryName or not) that you cannot apply both a SetStopLoss() and SetTrailStop() to it? From my testing, it doesn't seem to matter what sequence they are initialized, SetStopLoss() will take precedence when both are used and render SetTrailStop() processing inoperable. This nuance, including the insight that a specified or non-specified fromEntryName can utilize SetStopLoss() or SetTrailStop() but not both, should be clarified in the Help facility. Whitmark
Last edited by whitmark; 06-17-2007 at 10:12 AM.
|
|
|
|
|
|
#8 |
|
Certified NinjaScript Consultant
|
This discussion has evolved to another thread to be continued on:
http://www.ninjatrader-support.com/v...ead.php?t=2426 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Superdom Prices?? | Tripspike | SuperDOM and other Order Entry Windows | 5 | 06-15-2007 01:12 PM |
| SetTrailStop() | funk101 | Strategy Development | 1 | 04-04-2007 03:39 AM |
| setTrailStop() not executing | funk101 | Strategy Development | 1 | 04-02-2007 08:32 AM |
| SetTrailStop() | funk101 | Strategy Development | 8 | 03-27-2007 07:42 AM |
| Adjust displayed dom prices | jim c | ATM Strategies (Discretionary Trading) | 1 | 03-30-2005 01:09 AM |