Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Amending Orders

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

    Amending Orders

    Hi,

    What is the best way to amend an order quantity without the possibility of over fill?
    I'm worried about a scenario when I amend an order but in the meantime it gets filled in the market, what will happen then with the order?

    Thanks!

    #2
    Hello,

    You would need to check the state of the order in OnOrderUpdate and ensure that the order is still "Working" or "Accepted" before you change the qty:



    However, there can for sure be race conditions between the time you last checked the order and when you modify the order.

    The best practice would be to not try to change an order that would be risk of being filled. Anything close to the current price could update as filled at any time and would be at a greater risk for overfill.

    You will also want to ensure that the order will not soon be canceled. Reasons for orders canceling would be if a paired OCO order is close to being filled, which would result in the corresponding order being canceled. This can also come from an order expiring if it is not set to LiveUntilCanceled or if you deliberately cancel the order using CancelOrder()
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    649 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    576 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X