Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution question...

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

    OnExecution question...

    Hi,

    I believe I know the answer to this question, but just wanted to double check.

    If OnExecution is called on a partial fill of an order... then the IOrder.token will match my initial token returned from the original order call, correct? For every "partial fill" going into OnExecution?

    #2
    Yes. Watching underlying IOrder object from the OnExecution can pose race conditions as well. For instance, if you have partial fills and are receiving OnExecution events. Let us say you had 3 part fills. On your second execution if you checked IOrder for order status you can easily get a returned state of Filled even though you have not received all 3 of the execution events yet.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Yes. Watching underlying IOrder object from the OnExecution can pose race conditions as well. For instance, if you have partial fills and are receiving OnExecution events. Let us say you had 3 part fills. On your second execution if you checked IOrder for order status you can easily get a returned state of Filled even though you have not received all 3 of the execution events yet.
      Josh,

      As always, appreciate the quick response.

      In your example, I'm still guaranteed to get all 3 calls into OnExecution... correct? I just can't rely on IOrder having the right status? If so, I'll just calculate the number of shares actually sold/bought based on the field in IExecution, which I assume is always correct...

      And in the case of TDAmeritrade (as discussed in the autotrading forum)... it doesn't matter, because IOrder returns filled for partial fills in any case.

      Comment


        #4
        That would be the way to go.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        67 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        150 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X