Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cancel MIT Limit Pending Orders in a Strategy

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X