And this is in a normal market not a disorderly one. One needs to assume everything can go wrong. Even the "corrections" can go wrong. With these assumptions the code is very complex. It will be more than the algo code, way more. Examine transaction roll back methods. Draw up a framework for Algo wrong, Algo-broker wrong, broker exchange wrong, XXX wrong, but only delayed and then corrects.
Basically for every transaction, you need to hold it in a sand box and compare it to the reported state, then keep all those until the entire transaction is complete. With OCO orders, this is a lot. With reversals, more and more with multiple contracts (positions).
Do this on a branched version of the code base. There about 2x-3x more code to write for this. That is why your "dev" did not do it. Testing is even more work because, as you know, you cannot do it in Sim, but you will have to create the error conditions live and include the broker and exchange, such as loss connection or very large delays not only in the sending, but in the confirmation.
If you want to go down this path, write a separate order handler that works with all algos not just this one.
PS: I think the NASDAQ site has some information on order handlers and best practices that they implement between the exchange and the FCM-IB.
Thanks for posting this. I'm no code guru, far from it. I know enough to get my own algos coded, and then use the VS debugger to work out problems. It works, but it's all pretty sloppy. I so need to learn how to do all that and more. You've just given me the push I needed. Thanks, again.

