How to set up OCO orders in your trading platform

An OCO (one-cancels-the-other) order is two linked orders where one fills, the other cancels. Useful for breakouts, stop-losses paired with profit targets, and re-entries. Here's how to set them up.

Disclaimer

This is not investment advice. The information provided is for educational and informational purposes only and does not constitute a recommendation to buy or sell any financial product.

An OCO (one-cancels-the-other) order is two linked orders where one fills, the other automatically cancels. The order is useful when you want to exit a position at one of two price levels — typically a profit target or a stop-loss — but not both. The first one to fill wins; the other is cancelled.

This article is a practical walkthrough: when OCO orders make sense, how to set them up on a typical platform, and what to watch for.

When OCO orders make sense

Three common uses:

  1. Bracket orders. A long position with both a profit target and a stop-loss. Place a sell limit above the current price and a sell stop below. Whichever hits first fills, the other cancels. The position is closed at one of the two prices.
  2. Breakout entries. A trader waiting for a breakout above resistance or a breakdown below support. Place a buy stop above resistance and a sell stop below support. The first to trigger enters the position; the other cancels.
  3. Re-entries. A trader who wants to be long above a level and short below. Same structure as the breakout entry but with both sides of the position managed.

The common pattern: OCO orders are about choice. You don't know which side will fire first, but you want to be ready for both.

How to set up an OCO on a typical platform

The exact steps vary by broker, but the structure is the same. On most platforms (thinkorswim, Interactive Brokers, Tastyworks, TradeStation):

  1. Right-click on the position or open the order ticket. Most platforms have an OCO option in the order type dropdown.
  2. Set the first leg. This is usually a limit order (profit target) or a stop order (stop-loss).
  3. Set the second leg. The complementary order.
  4. Link the two legs as OCO. Most platforms have a checkbox or button to mark the order as OCO.
  5. Submit. The platform sends both orders; one fills, the other cancels automatically.

The platform also lets you adjust the prices and the order types after submission. The OCO link is maintained until one of the legs fills or you cancel both manually.

Common variations

OCO with a stop-limit on the stop side

A plain stop order converts to a market order when triggered, which can produce slippage in volatile markets. A stop-limit order converts to a limit order at a specified price, avoiding slippage but risking non-fill if the price gaps through the limit.

The trade-off: stop-market fills with slippage; stop-limit fills at a specified price or not at all. The OCO can combine a stop-market (for the stop-loss) with a limit order (for the profit target), or stop-limit for both.

Trailing stop OCO

A trailing stop is a stop that adjusts as the price moves in your favor. A trailing stop OCO combines a trailing stop (the stop-loss that follows the price up) with a limit order (the profit target). The position closes at the trailing stop if the price reverses, or at the limit if the target is hit first.

The trailing stop OCO is useful for momentum trades where you want to capture a multi-day move but exit on a reversal. The trailing stop locks in profits as the price rises; the limit target provides an upside exit.

Time-bound OCO

Some platforms let you set an expiry on the OCO. The OCO is cancelled automatically at the expiry time if neither leg has filled. Useful for setups that are only valid during a specific time window (e.g., an earnings announcement or a market open).

The expiry is platform-specific. Some platforms default to "good till cancelled" (GTC), which means the OCO stays active indefinitely. Others default to "day" or "good till close" (GTC). Set the expiry deliberately based on the strategy.

What can go wrong

Three patterns:

1. Both legs triggering in fast markets

In a fast-moving market, both legs can trigger within the same millisecond. The platform may fill one, the other, or both — depending on the order routing. The "OCO" guarantees only that one is cancelled if the other fills first; if both fill before the platform can cancel, the result is a partial close or a flip to the opposite side.

The fix: don't use OCO in markets likely to gap through both levels. Use a stop-market with a buffer or accept the risk of a partial fill.

2. The stop-leg triggering on a wick

In a candle wick, the price briefly hits the stop level but closes above. A stop-market order triggers on the wick and fills at the stop price (or worse). The OCO cancels the limit, but you exited on noise.

The fix: use a stop-limit with a buffer, or use a time-based confirmation.

3. The platform not supporting true OCO

Some platforms only support "linked orders" or "if-touched" orders, which look like OCO but have different cancellation logic. Read the platform documentation to confirm the OCO behavior.

How to evaluate

When setting up OCO orders, ask:

  • Does the platform support true OCO? (Test with a small order in a liquid name to confirm the behavior.)
  • What order types are supported on each leg? (Stop-market, stop-limit, trailing stop, limit. The more options, the more strategies you can run.)
  • What's the expiry default? (Day, GTC, or custom. Set deliberately.)
  • What's the partial-fill handling? (If only 50% of the limit leg fills, does the OCO cancel? Most platforms cancel; some keep the unfilled leg active.)
  • What's the slippage on the stop leg? (Stop-market fills with slippage. Test in a paper-trading account to see the actual fill quality.)

FAQ

Is OCO the same as a bracket order?

A bracket order is a specific type of OCO: an entry order with both a profit target and a stop-loss linked as OCO. The general OCO can be any two linked orders; the bracket is one common use case.

Can I set up an OCO across multiple accounts?

Most platforms don't support cross-account OCO. The OCO is set up at the position level within a single account.

What's the difference between OCO and OTO (one-triggers-the-other)?

An OTO is two orders linked so that the second order is placed only when the first fills. An OCO is two orders linked so that the second is cancelled when the first fills.

Do all brokers support OCO orders?

Most tier-1 brokers do, including Interactive Brokers, Schwab, Tastyworks, TradeStation, and E*TRADE. The implementation varies.

Related resources

Where to start

If you want to use OCO orders in your trading, the practical first step is to set up a paper-trading account with a broker that supports the order type and test the behavior with small positions. The paper account is the only way to verify the platform's OCO logic before committing real money. See our broker table for the current list of platforms with OCO support.