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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X