Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When the order is finalized and in the state of no further processing

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

    When the order is finalized and in the state of no further processing

    How can I detect that an order is in its final state, I mean the state where it will never get changed after that.
    I need to make sure that I don't miss any state, so would you check the following snippet and let me know is it comprehensive.

    private bool IsOrderFinalized(Order order)
    {
    var state = order.OrderState;
    return state == OrderState.Filled || state == OrderState.Cancelled || state == OrderState.Rejected || state == OrderState.Unknown; // I think Unknown means an error occur perhaps during submission
    }
    Last edited by ManTrader; 07-07-2019, 01:42 PM.

    #2
    Hello ManTrader,

    Welcome to the NinjaTrader forums!

    Yes, checking the OrderState is Filled, Cancelled, or Rejected in OnOrderUpdate() would be correct.

    Are you finding that this is not behaving as you are expecting?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Oh, I have found IsTerminalState static member do exactly same. Thank you for the link.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by kinfxhk, 07-14-2026, 09:39 AM
      0 responses
      15 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 10:18 AM
      0 responses
      59 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 09:50 AM
      0 responses
      42 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-13-2026, 07:21 AM
      0 responses
      47 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 07-11-2026, 02:11 AM
      0 responses
      38 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X