OCO (One-Cancels-Other) orders are an advanced trading tool that allows you to set up two linked orders simultaneously. When one order is triggered and executed, the other will automatically be canceled. This is an ideal solution for automating trading strategies and enhancing your risk management on the market.
How does an OCO order work?
The OCO system is designed with two trigger points in opposite directions: one above the current market price (limit above) and one below (limit below). When the market price hits one of these points, the system automatically executes the corresponding order and cancels the other.
When you place an OCO order, margin costs are only calculated on one side. This helps you use your trading capital more efficiently without needing to allocate additional margin for both orders. OCO orders support combining conditional market orders with conditional limit orders, providing high flexibility in managing positions.
Main advantages of OCO orders
Using OCO orders offers several benefits for traders:
Automated strategy execution: You can set both a stop-loss and a take-profit order for an asset simultaneously. When one condition is met, the order executes automatically without manual intervention.
Optimal risk management: OCO orders let you predefine both your profit target and acceptable loss level. This helps you trade with higher discipline and avoid emotional decisions.
Saving margin: Since margin costs are only applied to one side, you can manage multiple positions with the same capital.
Flexibility in volatile markets: You prepare for multiple price scenarios at once, ready for both support retracements and resistance breakouts.
Important limitations
Limit orders may not execute: Conditional limit orders can be triggered but may not be filled if the market lacks sufficient liquidity or surpasses the set price. In such cases, the opposite order will automatically be canceled even if no actual trade occurs.
No API support: Users trading via API cannot use OCO orders directly, as they can build similar systems through programming tools.
Only for margin trading: Currently, OCO orders are only available for users participating in Spot Trading or Margin Spot Trading.
Example trading strategy with OCO orders
Suppose BTC is trading at $27,000. You notice the price has retreated from the resistance at $30,000 and now supports around $25,000. You predict two possible scenarios: either a pullback to the support at $25,000 or a continued rise breaking through resistance at $30,000.
To prepare for both, you use an OCO order:
Place a conditional market order (take-profit) with an activation price at $25,000
Place a conditional market order (stop-loss) with an activation price at $30,000
If BTC pulls back to $25,000: The take-profit order triggers first. You buy BTC at the current market price. The stop-loss at $30,000 will automatically be canceled since the strategy has been executed at support.
If BTC continues rising to $30,000: The stop-loss order triggers first. You buy BTC to participate in the new upward move. The order at $25,000 will be canceled as the retracement opportunity has passed.
This approach allows you to “catch” the market at both key points without constantly monitoring prices.
Example of a sell strategy with OCO orders
Trader B holds 2 ETH bought at an average of $1,500. The current price is $1,700. You are optimistic ETH could rise to $2,000 soon but also want to protect your capital by setting a breakeven target at $1,500.
You set an OCO sell order:
Place a conditional market order (take-profit) with an activation price at $2,000
Place a conditional market order (stop-loss) with an activation price at $1,500
If ETH rises to $2,000: The take-profit order triggers. You sell all 2 ETH to realize a profit of $600 (from $1,700 to $2,000). The stop-loss order is canceled.
If the market declines to $1,500: The stop-loss order triggers first. You sell ETH to exit the position at breakeven. The take-profit order at $2,000 will be canceled.
With an OCO order, you can hold your position confidently without worrying about two different scenarios.
Common mistakes when using OCO orders
Mistake 1: Forgetting that conditional limit orders may not execute: If you set a limit order with a price too far from the market, it may never be triggered. In that case, the order remains unfilled, but the opposite order will still be canceled.
Mistake 2: Setting the wrong trigger price direction: For buy orders, the take-profit trigger price should be below the current price (for retracement), and the stop-loss should be above (for breakout). Reversing these will cause the order not to work as intended.
Mistake 3: Not checking margin requirements: Although margin costs are only on one side, you still need sufficient margin for the largest order in the OCO pair.
Mistake 4: Using OCO for short-term positions: OCO orders are most effective for longer-term strategies or when you cannot monitor the market constantly. For hourly trades, manual control may be more flexible.
How to check and manage your OCO orders
You can monitor all pending OCO orders in the Open Orders tab. To view details of executed or canceled OCO orders, go to the Order History tab.
Additionally, you can access directly via your account management page:
Go to Unified Trading Account
Select Spot Orders
View Current Orders or Order History
From there, you can modify, cancel, or create new OCO orders as needed. The system records detailed information for each order, helping you analyze your trading strategy performance.
When should you use OCO orders?
OCO orders are most suitable in situations where:
You expect not to monitor the market continuously: OCO automates the process, freeing you from constant oversight.
You want disciplined trading: Pre-setting both profit and loss levels helps avoid emotional decisions.
You prepare for multiple market scenarios: OCO allows simultaneous bets on retracements and breakouts.
You want to optimize margin usage: Margin costs are only on one side, making capital management more efficient.
OCO orders are powerful tools but require a clear understanding of their operation. Mastering this technique will significantly improve your risk management and automate your trading strategies on the market.
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
What is an OCO order? A guide to smart trading strategies
OCO (One-Cancels-Other) orders are an advanced trading tool that allows you to set up two linked orders simultaneously. When one order is triggered and executed, the other will automatically be canceled. This is an ideal solution for automating trading strategies and enhancing your risk management on the market.
How does an OCO order work?
The OCO system is designed with two trigger points in opposite directions: one above the current market price (limit above) and one below (limit below). When the market price hits one of these points, the system automatically executes the corresponding order and cancels the other.
When you place an OCO order, margin costs are only calculated on one side. This helps you use your trading capital more efficiently without needing to allocate additional margin for both orders. OCO orders support combining conditional market orders with conditional limit orders, providing high flexibility in managing positions.
Main advantages of OCO orders
Using OCO orders offers several benefits for traders:
Automated strategy execution: You can set both a stop-loss and a take-profit order for an asset simultaneously. When one condition is met, the order executes automatically without manual intervention.
Optimal risk management: OCO orders let you predefine both your profit target and acceptable loss level. This helps you trade with higher discipline and avoid emotional decisions.
Saving margin: Since margin costs are only applied to one side, you can manage multiple positions with the same capital.
Flexibility in volatile markets: You prepare for multiple price scenarios at once, ready for both support retracements and resistance breakouts.
Important limitations
Limit orders may not execute: Conditional limit orders can be triggered but may not be filled if the market lacks sufficient liquidity or surpasses the set price. In such cases, the opposite order will automatically be canceled even if no actual trade occurs.
No API support: Users trading via API cannot use OCO orders directly, as they can build similar systems through programming tools.
Only for margin trading: Currently, OCO orders are only available for users participating in Spot Trading or Margin Spot Trading.
Example trading strategy with OCO orders
Suppose BTC is trading at $27,000. You notice the price has retreated from the resistance at $30,000 and now supports around $25,000. You predict two possible scenarios: either a pullback to the support at $25,000 or a continued rise breaking through resistance at $30,000.
To prepare for both, you use an OCO order:
If BTC pulls back to $25,000: The take-profit order triggers first. You buy BTC at the current market price. The stop-loss at $30,000 will automatically be canceled since the strategy has been executed at support.
If BTC continues rising to $30,000: The stop-loss order triggers first. You buy BTC to participate in the new upward move. The order at $25,000 will be canceled as the retracement opportunity has passed.
This approach allows you to “catch” the market at both key points without constantly monitoring prices.
Example of a sell strategy with OCO orders
Trader B holds 2 ETH bought at an average of $1,500. The current price is $1,700. You are optimistic ETH could rise to $2,000 soon but also want to protect your capital by setting a breakeven target at $1,500.
You set an OCO sell order:
If ETH rises to $2,000: The take-profit order triggers. You sell all 2 ETH to realize a profit of $600 (from $1,700 to $2,000). The stop-loss order is canceled.
If the market declines to $1,500: The stop-loss order triggers first. You sell ETH to exit the position at breakeven. The take-profit order at $2,000 will be canceled.
With an OCO order, you can hold your position confidently without worrying about two different scenarios.
Common mistakes when using OCO orders
Mistake 1: Forgetting that conditional limit orders may not execute: If you set a limit order with a price too far from the market, it may never be triggered. In that case, the order remains unfilled, but the opposite order will still be canceled.
Mistake 2: Setting the wrong trigger price direction: For buy orders, the take-profit trigger price should be below the current price (for retracement), and the stop-loss should be above (for breakout). Reversing these will cause the order not to work as intended.
Mistake 3: Not checking margin requirements: Although margin costs are only on one side, you still need sufficient margin for the largest order in the OCO pair.
Mistake 4: Using OCO for short-term positions: OCO orders are most effective for longer-term strategies or when you cannot monitor the market constantly. For hourly trades, manual control may be more flexible.
How to check and manage your OCO orders
You can monitor all pending OCO orders in the Open Orders tab. To view details of executed or canceled OCO orders, go to the Order History tab.
Additionally, you can access directly via your account management page:
From there, you can modify, cancel, or create new OCO orders as needed. The system records detailed information for each order, helping you analyze your trading strategy performance.
When should you use OCO orders?
OCO orders are most suitable in situations where:
OCO orders are powerful tools but require a clear understanding of their operation. Mastering this technique will significantly improve your risk management and automate your trading strategies on the market.