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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        578 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 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
        554 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