Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 NRITV, Today, 01:15 PM
      2 responses
      8 views
      0 likes
      Last Post NRITV
      by NRITV
       
      Started by frankthearm, Today, 09:08 AM
      7 responses
      31 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by maybeimnotrader, Yesterday, 05:46 PM
      5 responses
      26 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by quantismo, Yesterday, 05:13 PM
      2 responses
      19 views
      0 likes
      Last Post quantismo  
      Started by adeelshahzad, Today, 03:54 AM
      5 responses
      33 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X