Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Cancel MIT Limit Pending Orders in a Strategy
Collapse
X
-
Cancel MIT Limit Pending Orders in a Strategy
Hi, in my strategy I place MIT Limit Pending Orders that may not get filled and may remain active after my strategy close a position at profit or stop loss target; there is gotta be a way to cancel/close those pending orders without going through advanced order management and monitoring past orders, which is becoming a headache for me coding it now. How can I cancel all pending orders once my Position.Quantity is back to 0 (any positions closed) and before executing the next new trade cycle? I really need help here.... Thanks.Tags: None
-
Hello shahabjet1,
Thank you for your post.
There's not really a good option for you here. To cancel pending orders you would need to track with Order objects and use CancelOrder(), or let them cancel on their own with IsLiveUntilCancelled set to false for the order, in which case they would be automatically cancelled once the conditions that triggered the order submittal are no longer true. There would not be a way to cancel all pending orders for the strategy otherwise without using Account.Flatten(), which would flatten all positions and cancel all pending orders on the account for the instrument in question and also disable the strategy.
Please let us know if we may be of further assistance to you.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
113 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
60 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
81 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment