oploss() in same group. Would my Stop Loss update dynamically.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Dynamic Stoploss
Collapse
X
-
Hello JLSwin,
I'm not quite understanding the logic, but after the entry has filled and the position is taken you can definitely update the stop loss to a new price.
If using SetStopLoss(), this will need to be reset using CalculationMode.Ticks one line before the entry method is called.
Below is a link to examples.
Chelsea B.NinjaTrader Customer Service
-
Chelsea, Thanks for your answer, My logic after a certain amount of unrealized PnL, moving the stopLoss to lock in gains similar to break even, in the ATM. Looking to accomplish through code, the reason for the if condition statement. Actually thinking about it, the logic for the break even in code would possibly make it possible. For example, if the stopLoss was set at 30 ticks below entry, and unrealized crossed above 30 ticks, the the stop loss moves locking profit in.
Comment
-
Hello JLSwin,
Are you using Atm Strategy methods? (Are the entries being submitted with AtmStrategyCreate()?)
The example I have provided is of a dynamic trailing stop behavior.
Below is a link to a simple example of a breakeven with the Strategy Builder.
And a link to an example of resetting SetStopLoss() before placing a new entry to prevent an invalid price error.
As well as the forum post that discusses this.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Stuffy2649, 03-15-2025, 08:58 AM
|
2 responses
14 views
0 likes
|
Last Post
![]() |
||
Started by lawrencey, Today, 03:48 AM
|
0 responses
10 views
0 likes
|
Last Post
![]()
by lawrencey
Today, 03:48 AM
|
||
Started by AaronMG, Today, 03:15 AM
|
0 responses
8 views
0 likes
|
Last Post
![]()
by AaronMG
Today, 03:15 AM
|
||
Started by BethLsea, Today, 03:07 AM
|
0 responses
6 views
0 likes
|
Last Post
![]()
by BethLsea
Today, 03:07 AM
|
||
Started by GustavoRodrigzS, 01-07-2025, 05:02 PM
|
1 response
75 views
0 likes
|
Last Post
![]()
by Kolumbiann
Today, 02:25 AM
|
Comment