- Entry order is placed long with a quantity of 100 and filled.
- A limit order and stop order is created after being filled. The limit order is for a quantity of 50, and the stop order is created as a quantity of 100. They are both part of the same OCO group.
- The limit order is now partially filled, say with a fill quantity of 10.
As the limit order is partially filled, the stop order quantity adjusts. The stop order quantity adjusts as a percent. After step 3, the limit order will now be for 40, as expected, but the stop order will now be for 80.
If the instrument then moves to stop out the rest of the order, there will be a quantity of 10 left unfilled.
If the above scenario is executed via code, code in the ExecutionUpdate event handler for Account could adjust the stop order to make sure it will close out the position and not leave the 10 shares hanging. The code however will be running on the users computer, and not at the broker. This leads to the following questions.
Is the OCO mechanism for orders handled completely locally and not by the broker?
Comment