Whitmark
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Get Prevailing Stop Prices for SetTrailStop()
Collapse
X
-
Get Prevailing Stop Prices for SetTrailStop()
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.
WhitmarkTags: None
-
The help on SetTrailStop() states:
Is there an open issue with using SetTrailStop() dynamically for an open position in the manner I descibed earlier? For this to work dynamically, is it required that I supply all the parameters especially the fromEntrySignal? Do I need to restate the command on each bar?You may call this method from within the strategy OnBarUpdate() method should you wish to dynamically change the trail stop price while in an open position
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,
WhitmarkLast edited by whitmark; 06-16-2007, 11:33 AM.
Comment
-
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.
Seems as though my issues with SetTrailStop() working has to do with the concurrent use of SetStopLoss(). While testing, I can SetTrailStop() to just a few ticks and see that a named "Trail stop" order takes me out of most trades. However, when I add a SetStopLoss(), even with a huge stop loss setting, it appears that that SetTrailStop processing is suppressed and I no longer see any "Trail stop" orders being submitted although my trailing stop level has been breached.Syntax
SetTrailStop(double currency)
SetTrailStop(double currency, bool simulated)
SetTrailStop(CalculationMode mode, double value)
SetTrailStop(string fromEntrySignal, CalculationMode mode, double value, bool simulated)
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
Comment
-
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.
WhitmarkLast edited by whitmark; 06-17-2007, 10:12 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
574 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
332 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment