I have written a code in Indicator to listen to OrderUpdate events. I do see get order state as Unknown. Why the state is in unknown state ? How do I know the actual state of the order ? I have written some logic which is heavily depends on Order State.
Sample Order Log:
NQ15MO_Altarget-515363-0393F72A 225 State : Unknown orderId=‘b13fa7fb0e4949cf9e3c489a54c9f655’ account=‘BX67617-02’ name=‘NQ15MO_Altarget-515363-0393F72A’ orderState=Unknown instrument=‘NQ JUN25’ orderAction=Sell orderType=‘Limit’ limitPrice=21745.25 stopPrice=0 quantity=1 tif=Gtc oco=‘’ filled=0 averageFillPrice=0 onBehalfOf=‘’ id=225 time=‘2025-06-04 08:23:05’ gtd=‘2099-12-01’ statementDate=‘2025-06-03’
Hey, getting an OrderState.Unknown is a nightmare when you rely heavily on state management. It often points to a complex timing or object reference issue between the NT core and your custom logic. If your logic is highly dependent on order state, it should be managed within a Strategy for reliable control over the object lifecycle, not an Indicator
I have achieved absolute execution mastery in resolving these intricate order state synchronization issues across automated systems. If you need a review of your code logic to ensure reliable and technically flawless order state management, I can provide that optimization service for you
protected override void OnOrderUpdate(Order order, long submitted, long status, …)
{
(Check only for newly submitted or currently working orders.)
if (order.OrderState == OrderState.Submitted || order.OrderState == OrderState.Working)
{
(you should check what the actual order state is here.)
Print(order.OrderState.ToString());
}
(If ‘Unknown’ is received, it’s typically a non-fill status or a
transitory state you need to check the main OrderState (e.g., Filled, Cancelled).)
}
1 Like