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

unable to match order state to execution

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

    unable to match order state to execution

    Hi NT experts,

    I got multiple messages "unable to match order state to execution" when an order is executed by 3 partill filles. When i have an order completely filled by one execution, i did not get such message.

    The codes involing checking order state and execution are pasted below. Can anyone she some light on which ones are likely produce such message with partial fills?

    if (entryOrder != null && entryOrder.Token == execution.Order.Token)

    if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))

    #2
    binwang2,

    Due to race conditions it is possible for the underlying IOrder object to be further ahead than the execution event. You could be processing the first partial fill execution and when you check the IOrder it will be in a filled state. Instead, work off of the execution directly. You know what quantity you submitted at, you know the execution.Quantity. You can calculate out the rest.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    57 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    20 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    9 views
    0 likes
    Last Post cre8able  
    Working...
    X