Order TypesIntermediate

One-Cancels-the-Other OrderOCO

A one-cancels-the-other (OCO) order links two orders so that when one executes, the other is cancelled. The classic use is a stop-loss and a take-profit on the same position.

An OCO order links two orders so that when one fills, the other is cancelled. Traders use it to set a profit target and a stop-loss at the same time, so the position closes one way or the other without a leftover order. Availability and exact behaviour differ by broker and venue.

Category
Order Types
Reading time
3 min
Also called
One-cancels-other order, OCO bracket
Updated

OCO in plain words

A one-cancels-the-other (OCO) order links two orders: as soon as one fills, the other is cancelled.1

Think of it as a pair where execution of either one automatically kills its partner.2

Typically it pairs a stop with a limit order to manage risk on both sides.2

How to set up an OCO

  1. Open the position

    Buy or sell first, or attach the OCO to the entry.

  2. Pick a target

    Set a limit order at your profit level.

  3. Pick a stop

    Set a stop order at your exit level.

  4. Link them

    Link the two orders as an OCO so filling one cancels the other.1

  5. Let one trigger

    Let the platform handle it: once one leg executes, the other is cancelled automatically.2

  6. Check the result

    Check that the second order really is gone, so a leftover stop can't open an unwanted short.1

Worked examples

Example 1 — Target hit

+600.00

Hypothetical long at 40.00; OCO with target 46.00 and stop 37.00 on 100 shares.

Example 1 — Target hit — calculation
Target fills(46 − 40) × 100 = 600.00

The target filled, so the linked stop at 37.00 was cancelled automatically.2

Example 2 — Stop hit

−300.00

Same trade, but the price falls to 37.00.

Example 2 — Stop hit — calculation
Stop fills(37 − 40) × 100 = −300.00

Pairing a stop with a limit order covered both the downside and the target.2

Example 3 — Unlinked orders

Risk avoided

A hypothetical trader places a separate target and stop without linking them; the target fills.

Example 3 — Unlinked orders — calculation
Leftover stopStill live

Linking the orders prevents a stray stop from accidentally opening a short position.1

OCO vs separate orders

AspectOCOTwo separate orders
LinkLinkedIndependent
After one fillsOther cancelsOther stays live
Overfill riskLowHigher
SetupOne ticketTwo tickets

Where OCO orders help

Advantages and disadvantages

Advantages

  • Sets stop and target in one step.
  • Prevents a leftover order.
  • Removes the need to watch the screen.

Disadvantages

  • Not every broker or market offers it.
  • Gaps can fill the stop at a worse price.
  • Partial fills can complicate the link.
  • Both legs need matching time-in-force.

Going deeper

Read as far as you need. Each level builds on the one before it.

Definition

Beginner

Two orders, one outcome: the first to fill cancels the other.1

Risk control

Intermediate

The usual pairing is a protective stop with a profit-taking limit order.2

Why the link matters

Advanced

Without the link, a stop left behind after the target fills could trigger and open a brand-new trade.1

Common mistakes

  1. Different time-in-force

    Use the same on both legs.

  2. Stop too tight

    Allow for normal noise.

  3. Assuming it works in gaps

    Stops can slip.

  4. Not checking partial fills

    Confirm the remaining size.

Check your understanding

Test yourself before moving on. Each answer comes with an explanation.

Q1Entry 20, target 23, stop 19, 200 shares; target fills. P&L =
Q2What happens to the stop when the target fills?

Key points to remember

  1. OCO links two orders.
  2. When one fills, the other cancels.
  3. Classic use: target plus stop.
  4. Prevents stray orders.
  5. Availability differs by broker.

Frequently asked questions

Is OCO the same as a bracket?

A bracket usually adds the entry order to an OCO pair.

Do crypto exchanges offer OCO?

Many do, often on spot markets.

Can both legs fill?

Rarely, in very fast markets; check your broker's rules.

Further learning

Sources

This article is written in our own words. The sources below support the specific facts, rules and figures marked with a number in the text. Links open the original publisher’s page.

  1. Charles Schwab. How to Use Advanced Stock Order Types (opens in a new tab) Checked .
  2. Interactive Brokers. One Cancels Other (IBKR Glossary) (opens in a new tab) Checked .

Educational content, not financial advice. Examples use hypothetical prices and simplified costs; actual fees, margin rules and regulations vary by broker, market and country. We are not affiliated with any publisher linked above. Last reviewed . Report an error or request a source credit.