Skip to main content

OcO

OCO (One-Cancels-the-Other) order pairing a take-profit and a stop-loss leg; when either leg triggers, the other is automatically cancelled.

orderType stringrequired

OCO (One-Cancels-the-Other) order pairing a take-profit and a stop-loss leg; when either leg triggers, the other is automatically cancelled.

Possible values: []

clOrderIdstring

Client-assigned order identifier for tracking and idempotency.

symbolstringrequired

Trading pair symbol.

orderSidestringrequired

Order side: BUY or SELL.

Possible values: [BUY, SELL]

orderSizeint64required

Order size in number of contracts.

positionModestring

Position mode this order applies to (one-way or hedge).

Possible values: [ONE_WAY, HEDGE, ISOLATED]

Default value: ONE_WAY
timeInForcestring

Time-in-force policy applied to each leg once triggered.

Possible values: [FOK, GTC, IOC, HALFSEC, HALFMIN, FIVEMIN, HOUR, TWELVEHOUR, DAY, WEEK, MONTH]

Default value: GTC
reduceOnlyboolean

If true, both legs can only reduce an existing position.

postOnlyboolean

If true, each leg is rejected if it would take liquidity, ensuring maker-only execution.

takeProfitOrderPricedoublerequired

Limit price of the take-profit leg.

stopLossOrderPricedoublerequired

Limit price of the stop-loss leg once triggered.

stopLossTriggerPricedoublerequired

Price at which the stop-loss leg is triggered.

stopLossTriggerTypestring

Reference price type used to evaluate the stop-loss trigger.

Possible values: [INDEX_PRICE, LAST_PRICE, MARK_PRICE]

Default value: MARK_PRICE
OcO
{
"orderType": "LIMIT",
"clOrderId": "string",
"symbol": "string",
"orderSide": "BUY",
"orderSize": 0,
"positionMode": "ONE_WAY",
"timeInForce": "GTC",
"reduceOnly": true,
"postOnly": true,
"takeProfitOrderPrice": 0,
"stopLossOrderPrice": 0,
"stopLossTriggerPrice": 0,
"stopLossTriggerType": "MARK_PRICE"
}