OCO Order
Also known as: one-cancels-the-other, one cancels the other, one cancels other, bracket order, oco
What is it?
An OCO order, short for One-Cancels-the-Other, links two orders together so that the moment one of them fills, the other is cancelled automatically. The classic use is to bracket an open position with both an exit you want and an exit you are willing to accept: a take-profit limit above your entry and a protective stop-loss below it. Suppose you buy gold at 2,400 dollars, set a take-profit at 2,440 dollars and a stop-loss at 2,380 dollars, and bundle them as an OCO.
stateDiagram-v2
state "OCO armed<br/>Long gold @ 2,400" as Armed
state "Take-profit limit<br/>resting @ 2,440" as TP
state "Stop-loss<br/>resting @ 2,380" as SL
state "Position flat<br/>other leg auto-cancelled" as Flat
[*] --> Armed: Place both legs as one OCO
Armed --> TP: Price rises, 2,440 fills
Armed --> SL: Price falls, 2,380 triggers
TP --> Flat: 2,380 stop cancelled instantly
SL --> Flat: 2,440 limit cancelled instantly
Flat --> [*]: Exactly one exit fired
classDef tp fill:#3bb27333,stroke:#3bb273,color:#ffffff
classDef sl fill:#df2c5333,stroke:#df2c53,color:#ffffff
class TP tp
class SL sl
If price climbs and the limit at 2,440 fills, the stop at 2,380 is wiped off the book instantly; if price drops and the stop triggers first, the take-profit disappears. You never end up holding a leftover order that could open a new, unwanted position later. This is the backbone of hands-off, rule-based trade management, because it lets you define exactly one exit before you ever look away from the screen, removing the temptation to widen a stop or chase a target in the moment.
The common pitfall is wiring the two legs to the wrong sides or sizes, so a single trigger leaves you net short or doubles your exposure instead of simply flattening the position. Behaviour also varies by broker and venue, especially during gaps or fast moves where a stop may fill far from its set price, so confirm how your platform handles OCO before trusting it with size. Used correctly, it turns your plan into an automatic instruction rather than a decision you have to make under pressure.
Why it matters: An OCO turns your planned profit target and your stop-loss into a single automatic instruction, so exactly one exit fires and you never get stuck holding a stray order.
An OCO defines and enforces both exits in advance, which is the core of disciplined, automated trade management.
Real-world example
Long gold at 2,400 dollars with an OCO of a 2,440 take-profit and a 2,380 stop: if the 2,440 limit fills, the 2,380 stop is cancelled instantly, and vice versa.
How SignalBots handles it
Through the SignalBots MT4/MT5 Connector and TradingView webhooks, an incoming signal can place a bracketed OCO exit automatically, and the sub-10ms delivery narrows the window in which price can move before the protective leg is live.
Pro tip
Double-check that both legs point the correct direction and match your position size before you walk away, so one fill cleanly flattens the trade instead of flipping it.
Common pitfalls
Setting the two legs on the wrong sides or sizes, so a single trigger leaves you net short or doubles exposure instead of simply closing the position.
Frequently asked questions
What does OCO stand for?
It stands for One-Cancels-the-Other. It links two orders so that when one fills, the platform automatically cancels the other.
Why would I use an OCO instead of two separate orders?
Two separate orders can both stay live, so after one fills the other could open a brand-new unwanted position. An OCO removes that risk by cancelling the unfilled leg the instant the first one triggers.
Can I use an OCO to enter a trade, not just exit one?
Yes. You can bracket a breakout with a buy-stop above the range and a sell-stop below it, so whichever way price breaks, that order fires and the other is cancelled.
Will the stop-loss leg always fill at the exact price I set?
Not necessarily. A stop becomes a market order once triggered, so in fast moves or gaps it can fill worse than your set price; OCO controls which leg cancels, not the fill quality of the one that triggers.
Does every broker and platform support OCO orders?
Most major platforms do, but the exact rules and edge-case behaviour differ. Confirm how your specific broker handles an OCO, especially during news gaps, before relying on it with real size.