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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      307 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      349 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      178 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X