Skip to content
Sign In

oco - OCO Order Monitoring

Monitor existing orders and automatically cancel competing orders when one fills.

What is oco?

oco monitors a group of EXISTING orders on the exchange. When ANY order in the group fills, closes, or is cancelled, flipr.cloud automatically cancels ALL other orders in that group.

Perfect For:

  • Manually placed TP + SL orders that need OCO monitoring

  • Multiple entry orders where only one should fill

  • Complex bracket orders with multiple exit levels

Syntax

Smart Syntax
oco all|buy|sell|long|short|session
oco #tag

Parameters

scopeRequired

Type: keyword or tag | Default: all

Which orders to monitor. The list is determined ONCE at the start:

SyntaxOrders Monitored
oco allAll open orders for this symbol
oco buy or oco longAll open buy/long orders only
oco sell or oco shortAll open sell/short orders only
oco sessionOnly orders created in this webhook
oco #tagOrders with specific tag

Real-World Examples

1. Manual TP + SL with OCO Monitoring

Place individual TP and SL orders, then monitor them with OCO logic.

Smart Syntax
BTCUSDT on My_API_Key
// Clean slate
rem all
pos 0
// Enter position
market long 0.01
// Manually place TP and SL
limit short 100%p off e5% reduce
stoploss short 100%p off e2%
// Monitor them with OCO logic
oco sell

When the TP limit fills OR the SL stop triggers, the other order is automatically cancelled.

2. Multiple Entry Levels (Only One Should Fill)

Place 3 limit buy orders at different levels, but you only want ONE to fill.

Smart Syntax
ETHUSDT on My_API_Key
// Place 3 entry limits
limit long 0.3 off 1%
limit long 0.3 off 2%
limit long 0.3 off 3%
// Cancel others when one fills
oco buy

As soon as any buy order fills, the other two are cancelled. This prevents accumulating too large a position.

3. Tagged Order Groups

Monitor only specific tagged orders, leaving others alone.

Smart Syntax
BTCUSDT on My_API_Key
// Primary exit orders (tagged)
limit short 50%p off e3% reduce #primary
stoploss short 50%p off e1.5% #primary
// Secondary exit orders (different tag)
limit short 100%p off e8% reduce #secondary
// Monitor only primary group
oco #primary

Only primary orders (3% TP, 1.5% SL) have OCO logic. Secondary 8% TP order remains independent.

4. Session Orders Only

Monitor only orders created in THIS webhook, ignore old orders.

Smart Syntax
BTCUSDT on My_API_Key
// Don't cancel old orders
// Place new TP/SL for this entry
market long 0.01
limit short 100%p off e4% reduce
stoploss short 100%p off e2%
// Monitor only these 2 new orders
oco session

oco session ensures old orders from previous signals aren't affected.

When to Use oco

SituationBest Command
Simple TP + SL after entrysl-or-tp (easier!)
Custom TP/SL with specific settingsoco
Multiple entry levels (one should fill)oco
Scaled exits with partial fillsoco
Bracket orders on entryoco

Best Practices

  • Place orders BEFORE calling oco - OCO monitoring starts immediately, so orders must exist first

  • Use tags for complex setups - Tag related orders to monitor specific groups independently

  • Use oco session for safety - Prevents interfering with old orders from previous signals

  • Prefer sl-or-tp for simple cases - It's easier and creates+monitors in one step

How OCO Monitoring Works

The oco command starts monitoring orders. Implementation depends on exchange support:

ExchangeNative OCONotes
BinanceYesNative GTE_GTC OCO orders
ByBitYesNative position TP/SL linking
BitMEXYesNative OCO via clOrdLinkID
OthersFlipr.CloudFlipr.Cloud monitors orders (~1s polling)

Related Commands

sl-or-tp

- Easier TP+SL with automatic OCO (creates orders for you)

smart-oco

- Position-aware monitoring (cancels on position close/flip)

reset-oco

- Clear OCO monitoring groups

rem

- Manually cancel orders