//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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
80 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment