My strategy generates the error "The OCO ID cannot be reused" I'm aware the stock answer is:
The error "The OCO ID cannot be reused" indicates that your strategy has submitted an order that is reusing an OCO ID. You would need to ensure that the strategy instance is submitting new OCO-tied orders using unique OCO IDs.
What is unclear to me is, how do I control the OCO ID at the program level, especially since it appears to be an internal resource?
I've searched all through the documentation, and I can find no method that provides direct access to the OCO ID. Second, when the OCO ID does appear in an error message, it's a long string of random characters, nothing that I certainly set at the programmatic level. I've also tried all variations of EnterLong() and EnterLongLimit(), and I still get this error.
I am aware of ChelsaB code example on OCO orders (2 entry orders help! - NinjaTrader Support Forum) The bummer of that approach is, I then need to move to unmanaged orders, which becomes more complex.
You can see, I have major confusion on this. Given that this OCO ID appears to be internally generated, that I have no direct programmatic access to it, how exactly I'm supposed to modify my code to avoid this error condition?
Thanks

Comment