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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        65 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X