What Is a One-Cancels-the-Other (OCO) Order?

Updated July 9, 2026 5 min read

Placing two orders around a single position can create an awkward problem: what happens if both of them end up executing? A linked order structure exists specifically to prevent that.

The short answer

A one-cancels-the-other order, usually shortened to OCO, pairs two separate orders together so that if either one executes, the other is automatically canceled. The two orders typically sit on opposite sides of the current price — one designed to lock in a gain, the other to limit a loss — and whichever condition the market reaches first triggers execution of that order and cancellation of its partner. It’s a way of covering two possible outcomes without ending up with both trades going through.

Why linking the orders matters

Without the automatic cancellation, placing two separate orders around a single holding creates a real risk: the market could reach both target levels over time, causing both orders to eventually fill and leaving a position that doesn’t match the original plan — for example, unintentionally reversing from long to short, or ending up with no position at all when only an exit was intended. Linking the two orders so that a fill on one instantly cancels the other keeps the outcome consistent with the original single position.

A common use case

One frequent setup pairs a limit order above the current price, meant to sell if the price rises to a target, with a stop-loss order below the current price, meant to sell if the price falls to a level meant to cap the loss. Together, an OCO structure lets both a target and a downside limit sit in the market at the same time, with the understanding that only one of them should ever actually execute. This is different from placing a plain limit order alone, which addresses only one side of the outcome and leaves the other unmanaged.

How partial fills are typically handled

Because markets don’t always move in clean, complete steps, one leg of an OCO pair can sometimes receive a partial fill before the cancellation of the other leg is processed. How exactly that’s handled — whether the paired order is canceled entirely, reduced proportionally, or left briefly overlapping — depends on the specific rules of the broker or trading platform, which is worth checking before relying on the mechanism for a security that moves quickly or trades in a wide bid-ask spread.

Where OCO logic shows up elsewhere

The same one-fills-the-other-cancels logic is the backbone of a bracket order, which extends the idea by adding a third order — an initial entry — so that the profit target and stop-loss legs only become active once the entry itself has executed. Recognizing the OCO structure inside a bracket order makes the whole mechanism easier to follow, since it’s really just two ideas working together: an entry, and a linked pair managing the exit.

What to weigh

An OCO order is a coordination tool, not a guarantee of a particular price — each leg still behaves like the order type it is, subject to the same execution and price risks as a standalone order. Its value is in making sure two related orders don’t both go through and create a mismatched position, which becomes more useful the more a plan depends on treating an upside target and a downside limit as two sides of the same decision rather than two independent trades.