Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution() for cancelled OCO orders

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

    OnExecution() for cancelled OCO orders

    Hi,

    Do cancelled OCO orders (i.e. cancelled because the other pair is filled), get routed through OnExecution(). I am finding that OnExecution() is not called for these cancelled orders, but I wanted to double check with you first.

    Just wanted to mention that I am using unmanaged orders.

    Thanks.
    Last edited by coolguy8; 08-06-2012, 07:19 PM.

    #2
    From http://www.ninjatrader.com/support/h...nexecution.htm :

    "The OnExecution() method is called on an incoming execution. An execution is another name for a fill of an order."

    So if there's no fill (ie if the order is cancelled), it seems like OnExecution() won't be called.

    Comment


      #3
      Thank you very much for your help.

      Do you know if there is any way to get a trigger for cancelled orders? I would like to clean up some internal state variables when this occurs.

      Thanks!

      Comment


        #4
        Do it in OnOrderUpdate()

        Comment


          #5
          You can check the order state in OnOrderUpdate()

          Code:
          protected override void OnOrderUpdate(IOrder order)
          {
          
           if (order.OrderState == OrderState.Cancelled)
                   {
                        // Do stuff
          }
          MatthewNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, Yesterday, 10:06 AM
          0 responses
          17 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          16 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          14 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          9 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          38 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X