//partial selling 1 contract ExitLongLimit(BarsInProgress, true, 1, High[1] + (16 * TickSize), "PartialSell", "LongPos"); //stoploss - set for original quatity 2 ExitLongStopLimit(BarsInProgress, true, 2, execution.Order.AverageFillPrice - (32 * TickSize), execution.Order.AverageFillPrice - (32 * TickSize), "StopLoss", "LongPos");
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Partial close not updating stoploss set using ExitLongStopLimit
Collapse
X
-
Partial close not updating stoploss set using ExitLongStopLimit
Hi. Within OnExecutionUpdate method, I've this code to set stop-loss and partial position sell at limit price when a long position is filled. Code executes fine, it sets the sell limit and stop-loss orders alright. The problem is when the partial sell happens it kills the stop-loss order altogether instead of updating its quantity only. From this code I expect stop-loss to stay with quantity = 1 once partial sell is done. Please advise how can I resolve this. Thank you.
Code:Tags: None
-
Hello singjay,
NinjaTrader would not be changing the quantity of orders.
The script logic would have to change the quantity of an exit order with the ChangeOrder() method, or by submitting the order again with the new quantity using the same signal name.
You could choose to do that in OnExecutionUpdate() after the entry has part filled.
If you are using Set methods such as SetStopLoss(), the quantity for these should update automatically as these order methods are managed by platform.Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
91 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
137 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
121 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
72 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment