Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How ro verify an order is cancelled?

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

    How ro verify an order is cancelled?

    Hi NT experts,

    I would like to verify the cancellation of an order but pendingcancell is the most i can get.

    I've noticed that when i cancell an order, the order.OrderState will show pendingcancell as the last state. After it is fully cancelled, the order is automatically set to null. Any further inquiry into the status will yield error message as "Objetc reference not set to an instance of the object".

    Is there a way to get the status of OrderSate.Cancelled?

    any suggestions are welcome.

    #2
    binwang2,

    This suggests to me that your code is explicitly setting it to null by itself. The IOrder will never be set to null. Once it is null you can't access its old properties because it has been "erased".

    Find where you are resetting to null and don't do that step if you want to preserve old states.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      You are right. It is explitly set to null in OnOrderUpdate once an order is cancelled.

      Commented out that step and got Order.cancelled status.

      Thanks.

      Comment

      Latest Posts

      Collapse

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