Learn › Order types
Bracket, OCO and OTO Orders: How Attached Stops and Targets Work
When you enter a trade with both a stop-loss and a profit target, you have three orders that depend on each other: the entry, the protective stop and the target. Brokers offer linked order types so that these relationships are handled at the broker rather than by you or your software. Understanding exactly how they behave — and how they can fail — is essential before automating anything.
OTO: one-triggers-other
An OTO order is a parent order with one or more child orders that are only activated once the parent fills. Example: a limit buy at 500, which, once filled, activates a stop-loss sell at 485. Before the entry fills, the stop does not exist at the exchange, so it cannot accidentally open a short position.
OCO: one-cancels-other
An OCO pairs two orders so that when one fills, the other is cancelled automatically. The classic use is an exit pair on an existing position: a target limit sell at 530 and a protective stop at 485. If the target fills, the stop is cancelled; if the stop fills, the target is cancelled. Without the link, the surviving order would stay live and could later open an unwanted position in the opposite direction.
Bracket orders
A bracket order combines the two ideas: an entry that, when filled, triggers an OCO pair of exits. One instruction sets up the full trade plan — entry, stop and target — and the broker manages the relationships. Different brokers use different names for very similar products, such as bracket, cover, super or forever orders, and the exact rules differ. Read your broker's documentation rather than assuming that two products with similar names behave the same way.
Modifying the legs
Once a bracket is live, you may want to move the stop, for example to break-even or along a trailing level. Depending on the broker, this is done by modifying the existing stop leg in place or by replacing it, which can assign the leg a new order ID. Automated systems must track the current ID of every leg; acting on a stale ID can fail silently or modify the wrong order.
The leftover-leg problem
The most important practical risk with linked orders is this: the OCO link only covers the orders inside the bracket. If the position is closed by some other route — a manual market order, an automatic intraday square-off by the broker, a separate exit signal from your strategy — the broker may treat the bracket's remaining exit legs as still valid. Some brokers' terms state explicitly that exiting the position by other means leaves the target and stop-loss legs active.
A leftover stop-loss leg on a position that no longer exists is dangerous. Imagine a short position closed by a strategy signal, with the bracket's buy stop still resting above the market. If price later rises to that level, the stop fires and opens a brand-new long position that nobody intended.
How to protect against it
- Cancel before you close. When exiting through any route other than the bracket's own legs, first cancel the remaining legs, confirm the cancellation from the broker's order book, and only then send the closing order.
- Reconcile when flat. Periodically compare positions with open orders. If a symbol has no position but still has live exit orders, cancel them.
- Verify, don't assume. A cancel request being accepted is not the same as the order being cancelled. Read the order status back.
- Fail closed. If cancellation cannot be confirmed, do not send new entries on that symbol until the state is resolved, and alert a human.
- Check manually after unusual events such as broker square-offs, partial fills or connection outages.
Partial fills
If the entry fills only partly, brokers differ on whether the exit legs are sized to the filled quantity, the original quantity, or adjusted as further fills arrive. A mismatch can leave the exits covering more or less than the actual position. Test this behaviour on a paper account before relying on it.
Price rules and validation
Brokers validate bracket prices against the current market. A long bracket's stop generally must be below the current price and its target above it; otherwise the order is rejected. Prices must also respect the instrument's tick size. Automated systems should round to the tick size and check these rules before sending the order so that rejections are caught and reported clearly.
Order lifetime
Exit legs may be day orders that expire at the session close or good-till-cancelled orders that persist. Some brokers automatically expire long-lived GTC orders after a fixed period. A swing trade held for weeks may need its protective orders renewed.
Key takeaways
- OTO activates exits after the entry fills; OCO cancels one exit when the other fills; a bracket combines both.
- Closing a position by any other route can leave exit legs live — cancel and verify them first.
- Track leg IDs through modifications, handle partial fills, and test everything on a paper account before going live.
Educational content only. This guide explains general concepts and is not investment advice or a recommendation to trade any instrument. Trading involves substantial risk of loss, and historical or simulated results do not guarantee future performance. Read the Risk Disclosure.
