as my trade manager started doing crazy things during fast markets, I realize I need better order handling. So, some questions:
* Given a signal has a stop and target order, what is the FASTEST way and most SAFE way to close it so that I per definition can not get leftover contracts?
Basically, I can not just issue "cancel" on both and a sell order - then I have a chance that not only my sell is executed, but in the time it takes until the orders are cancelled, one of the target/stop orders may also trigger, leaving me with leftover contracts. So far, it looks to me like the only really safe way is to get rid of both (cancel), wait for the cancelled state to be reached, and then issue a market close order for the amount I got reported. I would like something a little faster...
* What happens in the case of an OverFill? I mean, I can track them. But how can I get rid of the surplus items? Example:
- Long 3 contracts
- Stop to sell 3
- Market order to sell 3
Somehow both get triggered, leaving me with -3 positions (three short) on the signal name. How can I legally close them without your order handling getting in my way? What do I order here? CloseLong (the original), or CloseShort (the new proper direction)? I have the code to track that, but I have no clue how to close them.
* Is there any way to get a list of signals your logic knows as well as what your logic think the position for that signal would be?

Problem is.... this IS prone to overfill, too, and if I do 90%, I can as well go to doing 100%.
Comment