Here goes.
The issues:
- Historical entry orders can get stuck in 'Working' state.
- Such stuck orders ignore attempts to cancel them.
- I have attached a Strategy file to demonstrate the issue.
- The file still has extensive print statements that I used to track order flow while trying to isolate the problem.
- The file also has copious comments, detailing my observations, and suggesting some tests (by uncommenting statements), to demonstrate that while I can code around the issue, the viability of the workaround is questionable.
Make targets and stops close enough that multiple historical bars will have entry and exit on the same bar. This seems to be a big part of the issue. When most trades exit on bars after entry, the problem does not arise quite as often.
- I used a daily timeframe on SPY. (I have also seen it on various futures and other stocks)
- Target ticks = 150.
- Stop ticks = 150.
I have attached some annotated diagrams from my installation, to illustrate a bit more clearly.
There is also a picture showing my NinjaTrader properties. This is from a brand new fresh installation on a physical computer (not virtual machine): there is no database needing to reset, but I will if that is what you direct.
Comment