I have an automated strategy that manages both trade entry and trade exit conditions. I can conceivably have a situation where an order, (say 6 contracts) is partially filled (only 4 of the 6 contracts) ... and the remainder of the order (2 contracts) gets filled after I've reached an exit condition. In this case, I need to do the following when I reach my exit condition ...
1) exit all of the contracts that I have currently active (do I need to specify the # of contracts that are active, or is there a catch-all function that closes all trades?)
2) need to cancel any outstanding orders that are left over from a partially filled order ... in the case above, the 2 remaining contracts. (how is this accomplished?)
Any assistance/advice is greatly appreciated.

Comment