¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: why bracket quantity reduces after parent filled?


 

A group of orders for the same instrument with parent/child relationship is ... a bracket order.

You probably could build an order construct without parent/child relationships for your scenario (using groups, and other features) but it will be challenging (or impossible) to protect your orders from the many things that can go really wrong (such over fills or order failures).

We can't design the exact solution for you, but here a couple paths you could explore. Both start with a traditional bracket order for entry, profit taking, stop loss, and other conditions. IBKR synchronizes order quantities based upon actual parent order fill or the entire set of orders gets cancelled. Nothing bad happens even if your client or TWS/IBGW crash or your network connection with IBKR gets disrupted for an extended period of time. The worst case is that the stop-loss order closes the position instead of reversing the position.

The first path to implementing position side reversal requires your client to be around and observe all order status callbacks. Once the parent order is filled

  • The actual entry order fill quantity is known
  • Quantities for all child orders are updated automatically
  • The child orders are now unrelated other than that they share the same group. IBKR automatically wraps the child orders of the bracket into an OCA so that only one child order executes and the others get cancelled.
  • Your client can now change the order quantity for the stop loss order without impacting the other orders in the group. In case the entry order filled completely, you'd simply double the stop loss order quantity. Upon partial fills you'd adjust based on the target reverse position.

The second path you could explore is a tree of bracket orders. You can have up to 20 open orders for the same instrument at any point in time. For this approach:

  • You place the same bracket order the first path uses
  • You attach a position reversal order to the stop loss order. It has the same same quantity and action (Buy or Sell) as the stop loss order.
  • Should the stop loss order trigger, it closes the position but also activates the attached reversal order.

I have not tried this, so there may be caveats but I'd expect that the position reversal order quantity is updated automatically to the actual stop loss order quantity. This would effectively reverse the position to the actual fill quantity of the entry order (which may be less than the originally requested quantity).

You could extend this approach such that the reversal order has siblings in the second level bracket (profit taker, close position at end of day, others) or you could attach profit and loss orders to the reversal order for a third level.

Attached an example of a two-level bracket that IBKR accepted (though it has not executed since markers are closed):

  • The main bracket has an entry parent order, a profit taker, a stop loss, and a close position at end of day order.
  • The stop loss order is the parent for a position reversal market order. Other order types would work, too.

Hope this helps,

´³¨¹°ù²µ±ð²Ô





On Thu, Sep 7, 2023 at 11:09 PM, <ofirbux@...> wrote:
Yes , i read it.
I understood that I cannot use bracket - so I'm looking for a solution of what i CAN use.
what is the best approach to go from position 1 to -1 and vice-versa , with different quantities between parent and childs?

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