Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to cancel just submitted order?

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

    Is it possible to cancel just submitted order?

    Hi,

    I need to cancel a order from OnOrderUpdate handler.

    For example, an order has just been submitted so is there any way to cancel this order from within OnOrderUpdate, when it comes there the first time.

    Thank you.

    #2
    Hello,

    This can be done if the order is in a working state.

    For example:
    Code:
    if (order == myOrderHandle && myOrderHandle.OrderState == OrderState.Working)
    CancelOrder(myOrderHandle);


    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Order states are:

      1) Initialized
      2) PendingSubmit
      3) Accepted
      4) Working

      Question 1: can I cancel at any status?
      Question 2: at what status(es) the cancellation is guaranteed, i.e. there is no chance that order may be filled (at least partially) on exchange?

      Comment


        #4
        Hello Alex.nt,

        Thank you for your response.

        You can cancel at any status, but there is no guarantee that a fill will not occur before the cancel is received by the broker and submitted.

        Please let me know if I may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        669 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        378 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X