//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, 05-11-2026, 05:56 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
32 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
195 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
356 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
277 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment