Like fx wrote in some posts and Josh wrote above I also see frequent deadlocking issues on just using 4 orders at a time where updates to as few as 2 LimitOrders place MilliSeconds, 30 seconds or minutes apart from other action, especially in the simulator. The deadlocks sometimes force a hard crash and reboot of NinjaTrader. When using the simulator this crash often corrupts NinjaTrader.sdf with a hung pending cancel or change order.
Recent Re-test Environment
I tested again roughly a month ago using a new bare-bones install of NT8 8.0.26.0 with zero Dlls from me or any third party installed and did see any improvement in the propensity to deadlock.
In order to test with a with a clean slate I leverage a recent strategy example you posted where I think you and Jim added management of a second order pair to the Unmanaged template. I leveraged those strategy changes forward to managing four orders concurrently.
I seeing deadlocking pretty quickly by submitting just two changeOrders in succession (like move both Buy Limit orders up by 1.5 points). The log shows that most often two successive changeOrders execute successfully with execute times both inside the same millisecond or just a few milliseconds apart and sometimes NT8 locks up when the execution happens a good distance in apart in milliseconds.
I was using test platform with 0.7-1.9 seconds of market data lag (measured at OnDataPoint in a BarType), CQG Continuum data, and a base TCP/IP latency from Chicago of 44ms.
The deadlocking issues persist when the NT8 Custom project is compiled in normal and in Debug modes.
The deadlocking issues persist when the VS 2022 is attached in Debug mode and when not attached.
The point of this post.. a request.
I do not know the scope of SFT-5163. Some text left me with the impression that SFT-1563 might be written to include mention of the faster ~"close some of the distance vs HFT" execution speed we all want and/or possibly managing very large number of orders.
So I wanted to ask that if the ChangeOrder() and CancelOrder() Cbi-Chart-Data pipeline deadlocking issues are being tracked in SFT-5163 as a feature enhancement please independently submit these concerns as a bug.
... As a bug without asking for enhancements to the current expected NinjaTrader feature set so these order management deadlocking bugs are more likely to get attention sooner.
From my perspective:
- I still agree with my earlier comments on this topic area, "Yes PlayBack and Simulation/Testing functionality is important but production order management reliability and features is much more important. So I would not want to see production features or quality hobbled to address these bugs."
- I would be happy with even very thin simple solutions if they improve reliability. Just early spitballing a few example ideas here:
--- While debugging, I have noticed deadlocks occur most often on the submission of the second ChangeOrder(). If it will reduce deadlocking, guidance and a sample of how when one is using Unmanaged Orders one should use the functionality of myAccount.Change(new[] { ... }); to submit all currently known change order requests within a single object array[] in a single call
https://ninjatrader.com/support/help...tml?change.htm
--- An informational-only public object we could monitor that shows when the NT internal code has locks in place for order change management or order related chart sync so we can see when locks are held by NT code but NT managed code process execution is not dependent on the lock being free so incorrect use by developers poses no risk to the execution health of NT provided code.
---E.g. public static object SyncChangeOrderLockIsHeld
--- An "IsLocked" public property bool we can check before submitting a CancelOrder() or ChangeOrder() request.
--- Guidance on where and how we should make more liberal use of "Dispatcher.InvokeAsync" when ChartTrader is active to reduce risk of deadlocking.
Thanks!
Hedge

Comment