OCO Order: One Cancels the Other

OCO orders link a stop-loss and take-profit into one pair: when one fires, the exchange cancels the other automatically.

TRADING & RISK3 min readBy AlgoSys Editorial TeamPublished Apr 25, 2026Updated Jun 26, 2026
Contents

An OCO order (from the English "One Cancels the Other") links two orders into a single pair: as soon as one triggers, the other is automatically cancelled. In practice this is a pair consisting of a stop-loss (a protective exit at a loss) and a take-profit (an exit at a profit) that guard a position simultaneously. The strength of this approach is that you fix both your profit-taking point and your capital-protection point in advance, and the market itself then decides which of the two scenarios plays out.

OCO is especially useful on volatile markets where price moves fast and unpredictably. You are not glued to the screen; instead, you define your exit plan in advance: where you will lock in profit and where you will accept that the idea did not work. The decision is made with a cool head, and emotions no longer interfere at the moment of a sharp move.

MECHANICS

Inside an OCO live two independent orders linked by a mutual-cancellation rule. One fires, and the exchange immediately cancels the other, so you are not left with a hanging order on a position that has already been closed.

The fee is charged only on the order that actually executes. If price reached the stop-loss, the fee is calculated at the stop-loss execution price. If the target fired first, the fee is calculated at the take-profit execution price. The second order is cancelled without a trade, and therefore without a fee. So you pay only for the actually completed leg of the trade, not for both legs at once.

EXECUTION

After placing an OCO it is worth verifying that the pair is indeed active and both levels are set correctly. Check that the order is visible in your open orders list, that the stop-loss and take-profit prices are where you intended them, and that the quantity matches your position size. A quick look at the market after setting up saves you from a situation where one level ended up in the wrong place or the order did not go through at all.

Let's walk through a concrete setup. Suppose you are long BTC from $60,000.

  • Entry: $60,000 (position already open).
  • Stop-loss (one OCO leg): $58,800, below the local low, risk $1,200 per unit.
  • Take-profit (the other OCO leg): $63,600, at the nearest resistance, potential $3,600.
  • R:R: risk $1,200 against profit $3,600 gives a ratio of 1:3.

Price moves up and touches $63,600: the take-profit executes, and the stop-loss at $58,800 is automatically cancelled. If instead the market reverses and breaks through $58,800, the stop executes and the target is cancelled. In both cases you need to do nothing manually.

How to tell a workable level from a false one: place the stop not right next to the entry but beyond a structural level (the nearest significant low for a long, a significant high for a short) plus a buffer for volatility, otherwise a random noise spike will knock you out before the idea has a chance to play out. Place the take-profit just short of a clear resistance, so the order fills in the queue before price pushes back.

COMMON MISTAKES

The main mistake with an OCO is manually cancelling one of the two legs without reconsidering the entire trade plan. You remove the stop-loss because "price is about to reverse," and the position is left without protection at exactly the moment it is most needed. This kills the whole point of an OCO and brings emotional decisions back into the trade, which is exactly what you were trying to avoid.

If the market has changed and the old levels are no longer valid, the right move is to recreate the OCO from scratch under the new plan rather than pulling one order from the pair and leaving the other dangling alone.

RISK FRAMEWORK

Before trusting real money to an OCO, run the strategy on historical data or in a simulator. See how often the stop-loss would have been hit and how often price would have reached the take-profit under various market conditions.

Such a run reveals the real win-to-loss ratio for your levels and helps you see whether the stop is too tight (gets knocked out by noise) or the target too far (almost never reached). Once you have tuned the levels so that the risk-to-reward ratio and trigger frequency satisfy you, OCO transforms from a convenient button into a deliberate risk-management tool.

FAQ

What is an OCO order in plain terms?

It is a pair of two linked orders, typically a stop-loss and a take-profit, that operates by the rule "one cancels the other." As soon as one order triggers, the exchange automatically cancels the second, so you are not left with a hanging order on a position that has already been closed.

Which order carries the fee in an OCO?

Only the one that actually executes. If the target fires first, the fee is calculated at the take-profit price; if the stop fires first, the fee is calculated at the stop-loss price. The second leg is cancelled without a trade, and therefore without a fee, so you pay only for the completed part of the trade.

Can you cancel just one leg of an OCO order?

Technically yes, but it is a common mistake. Removing, say, the stop-loss because you feel price is about to reverse leaves the position unprotected at exactly the moment protection is most needed. If the plan has changed, it is better to recreate the entire pair at the new levels rather than pulling one order out and leaving the other hanging alone.

Where should you place the stop-loss and take-profit in an OCO?

The stop goes beyond a structural level (the nearest significant low for a long, or a significant high for a short) with a buffer for volatility, so that a noise spike does not knock the position out prematurely. The take-profit is placed just short of a clear resistance, so the order has time to fill in the queue before price bounces.

Why backtest an OCO strategy before using it?

Running it on historical data or in a simulator shows how often the stop-loss would have been hit and how often price would have reached the target under various conditions. This helps you see whether your stop is too tight or your target too far, and find levels with a risk-to-reward ratio you are comfortable with.

Why is OCO useful on a volatile market?

When price moves fast and unpredictably, you define both exit points in advance and make no decisions in panic. The plan for locking in profit and protecting capital is set with a cool head, and from that point the market itself decides which of the two scenarios plays out, without your involvement.

Put this to work in the terminal

Live charts, derivatives, on-chain and macro data, free.

Open terminal →