Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DerkWehler, Today, 11:35 AM
    8 responses
    17 views
    0 likes
    Last Post DerkWehler  
    Started by DayTradingDEMON, 07-11-2024, 08:54 AM
    16 responses
    48 views
    0 likes
    Last Post DayTradingDEMON  
    Started by DawnTreader, 05-08-2024, 05:58 PM
    41 responses
    279 views
    0 likes
    Last Post DawnTreader  
    Started by tkaboris, Today, 01:42 PM
    0 responses
    1 view
    0 likes
    Last Post tkaboris  
    Started by Madtrade, Yesterday, 11:18 AM
    2 responses
    23 views
    0 likes
    Last Post Madtrade  
    Working...
    X