What a One‑Cancels‑the‑Other (OCO) Order Is
A one‑cancels‑the‑other order, usually shortened to OCO, is a pair of linked orders. You place two conditional orders at the same time and tell the broker or platform that if one order executes, the other should be automatically cancelled. The purpose is simple: you want to define two mutually exclusive scenarios and have the platform enforce the rule so you don’t end up in both outcomes.
In forex trading this is useful both for entering the market and for managing an open position. For example, you might want to enter a trade if price breaks out above resistance, but you also want to buy if price pulls back to a nearby support. Instead of risking being filled on both entries, you can set those two pending orders as an OCO pair so only the first to trigger remains active.
Trading carries risk. This article is educational and not personalised financial advice.
How OCO Orders Work in Practice
An OCO order usually combines two different order types (commonly a stop order and a limit order) and the same trade size. When the market reaches the trigger price of one order and that order is executed, the trading system automatically cancels the companion order.
Think of it as giving the market two mutually exclusive instructions: “If price goes to A, do this; if it goes to B instead, do that — but don’t do both.” The mechanism relies on the broker’s ability to link orders so that the cancellation happens immediately after execution.
Because brokers and platforms implement this feature differently, it’s important to know whether the OCO logic runs on the broker’s server (server‑side) or only inside your charting terminal (client‑side). If the logic is client‑side and your platform disconnects, the companion order may not be cancelled as expected.
Common OCO Setups in Forex
Traders use OCO orders in a few common ways. The paragraph below introduces each approach and then shows three typical setups.
One frequent use is to pair a take‑profit with a stop‑loss for an open position so that either the profit target or the stop will close the trade and the unexecuted instruction is removed. Another common use is for conditional entries — for example, one pending order to buy on a breakout and a second to buy on a retracement. A third use is to bracket a breakout: a buy stop above the range and a sell stop below the range so only the first breakout side is taken.
Common setups include:
- Stop‑loss plus take‑profit on an existing position.
- Entry on breakout (buy stop / sell stop) combined as OCO to avoid being filled on both sides.
- Entry on retracement (buy limit) combined with a breakout entry (buy stop) so only one entry executes.
Step‑by‑Step Example: Using OCO for a Breakout vs Retracement
Imagine EUR/USD is trading around 1.1200 and you see a recent swing high at 1.1240 and a nearby support at 1.1180. You want to get long if the pair breaks higher, but you’d also prefer to enter at a better price if it retraces.
First you decide on your two conditional entries and the position size. You place a buy stop at 1.1250 (to enter on breakout) and a buy limit at 1.1190 (to enter on a retracement). You submit these two pending orders as an OCO pair with the same lot size. If price rallies and hits 1.1250, the buy stop executes and the buy limit at 1.1190 is automatically cancelled. If instead price dips to 1.1190 first, the buy limit executes and the buy stop at 1.1250 is cancelled.
After the entry, you should set or confirm a stop‑loss and take‑profit appropriate to your risk management plan. Some platforms allow you to chain a stop‑loss and take‑profit to the executed order automatically (a bracket order). If your platform does not, you will need to place the protective stop and target manually once the trade is live.
Example: Using OCO to Manage an Open Position
Suppose you are long 0.5 lot EUR/USD at 1.1200 and you want to limit downside while defining a profit exit. You can place a stop‑loss sell order at 1.1150 and a take‑profit sell limit at 1.1300 as an OCO pair. If the market reaches 1.1300 and the take‑profit fills, the stop‑loss at 1.1150 is removed automatically. If the market reverses and the stop at 1.1150 fills, the profit target is cancelled.
This avoids the risk of both exits remaining live and creating unintended positions if one order were to be left active.
Practical Tips for Using OCO in Forex
Always set the same size for both orders and ensure both orders have compatible time‑in‑force settings so one isn’t cancelled by expiry while the other remains. Decide in advance which prices you’ll accept — setting orders too close to the market can lead to being stopped out by noise, whereas placing them too far may miss opportunities.
Be aware of market features that affect execution: spreads can widen, liquidity can fall during news, and price can gap at session opens. These factors affect whether the companion order cancels in the way you expect, and they can change the fill price you receive.
Also check how your platform implements OCO. Some platforms support native OCO groups, others require an Expert Advisor or script (for example, in MetaTrader), and some brokers provide OCO-like attributes when submitting bracket orders. Know whether the OCO logic is maintained on the broker’s servers or depends on your local terminal.
Risks and Caveats
OCO orders help automate a decision, but they do not remove market risk. In fast markets or during major news, price can move past your stop or take‑profit without filling at the expected price (slippage). Forex markets can experience sudden spreads and gaps; an executed order might fill at a worse price than the trigger, and the companion order may be cancelled after the fill but you could still receive an unexpected execution price.
Partial fills are another practical issue. Especially in thinly traded pairs or with large sizes, only part of your order may be filled. That partial execution can change the economics of your trade and may leave the cancelled companion order with a different net exposure than you intended.
Platforms and broker rules vary. Some will not allow certain combinations of order types in a single OCO group, and some treat OCO groups differently across instruments and account types. If your OCO logic runs only in your desktop app and that app is closed or disconnected, the companion order may not be cancelled as planned. Always test in a demo account before using OCOs with real money.
Trading carries risk and you can lose money. This information is educational and not personalised advice.
Key Takeaways
- An OCO order links two pending orders so that execution of one automatically cancels the other, commonly used for entries and for pairing stop‑loss with take‑profit.
- In forex, OCOs are handy for breakout vs retracement entries and for managing open positions without having two live exit orders.
- Watch for slippage, partial fills, widened spreads, and platform differences; test OCO behavior on your broker’s platform before trading live.
- Trading involves risk; this is general information, not personalised trading advice.
References
- https://www.forex.com/en-us/glossary/one-cancels-the-other-order-oco/
- https://trendspider.com/learning-center/what-is-a-one-cancels-the-other-oco-order/
- https://www.investopedia.com/terms/o/oco.asp
- https://www.avatrade.com/education/order-types/one-cancels-the-other-orders
- https://www.schwab.com/learn/story/how-to-use-advanced-stock-order-types
- https://www.youtube.com/watch?v=PIIx-05pNiw
- https://www.forex.com/en-au/trading-academy/courses/trading-with-forexcom/oco/
- https://www.interactivebrokers.com/campus/trading-lessons/using-the-one-cancels-another-oca-order-attribute-in-ibkrs-ibusopt/