开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Can a bracket order have two take profit orders to exit a position at two different profit levels?


 

I actually tried that (and slight variations) when I saw your original post last night, but it did not work for me.

What happens is that IB automatically sets the quantity for #3 to the same full amount of #1. I guess the basic idea is that the profit and stop legs of a bracket order should protect the entire position.

If you just place orders #1, #3, and #4 (no stop loss orders in the brackets) you can actually adjust quantities to Full/Half/Half right after the three orders are placed. Both via API or TWS. But once #1 was filled, IB again adjusted quantity of? #3 to the actually filled quantity. Again it was possible to adjust the quantity of #3 (the now active order) to Half via API or TWS.

When placing all five orders, quantity changes failed via API and the fields were greyed out in TWS.

JR


On Thu, Apr 29, 2021 at 10:22 AM, Levente wrote:
Unfortunately I did not have the luxury (time) to try this out myself, so a BIG thank you to Richard.
However, I managed to call IB API support and was suggested the following:

Create 5 (!!!) orders
1. Position opening order (assume ID is 1)
2. Stop loss order for the full amount (assume ID is 2) + set parent to 1
3. Take profit order for HALF of the amount?(assume ID is 3) + set parent to 1
4. Take profit order for HALF of the amount at the other price level (assume ID is 4)? + set parent to 3
5. Stop loss order for HALF of the amount (assume ID is 5) + set parent to 3

When position opening order fills, orders with ID 2 and 3 will get activated.
If stop loss order 2 fills, the take profit 3 will get cancelled and orders 4 and 5 will never activate.
If take profit order 3 fills, the stop loss order 2 will get cancelled, and orders 4 and 5 will get activated and will belong to a NEW OCA group.

I will try this out and will post my findings.

Join [email protected] to automatically receive all group messages.