Cancel all open orders on a symbol. This includes orders that are part of an order list.
Weight(IP): 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Request parameters.
Reduce the quantity of an existing open order.
This adds 0 orders to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read Order Amend Keep Priority FAQ to learn more.
Weight(IP): 4
Unfilled Order Count: 0
Security Type: TRADE
Notes: Data Source:* Matching Engine
Request parameters.
Cancel an active order.
Weight(IP): 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Notes:
If both orderId and origClientOrderId parameters are provided, the orderId is searched first, then the origClientOrderId from that result is checked against that order. If both conditions are not met the request will be rejected.
newClientOrderId will replace clientOrderId of the canceled order, freeing it up for new orders.
If you cancel an order that is a part of an order list, the entire order list is canceled.
The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only orderId is sent. Sending origClientOrderId or both orderId + origClientOrderId will be slower.
Request parameters.
newOrderResult: NOT_ATTEMPTED), will still increase the unfilled order count by 1.
You can only cancel an individual order from an orderList using this method, but the result is the same as canceling the entire orderList.not attempted (i.e. when newOrderResult: NOT_ATTEMPTED), will still increase the unfilled order count by 1.Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Similar to the order.place request,
additional mandatory parameters (*) are determined by the new order type.
Available cancelReplaceMode options:
STOP_ON_FAILURE – if cancellation request fails, new order placement will not be attempted.
ALLOW_FAILURE – new order placement will be attempted even if the cancel request fails.
| Request | Response | ||||
|---|---|---|---|---|---|
cancelReplaceMode |
orderRateLimitExceededMode |
Unfilled Order Count | cancelResult |
newOrderResult |
status |
STOP_ON_FAILURE |
DO_NOTHING |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
❌ FAILURE |
➖ NOT_ATTEMPTED |
400 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
| Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
N/A | ||
❌ FAILURE |
➖ NOT_ATTEMPTED |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
N/A | |||
CANCEL_ONLY |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
|
❌ FAILURE |
➖ NOT_ATTEMPTED |
400 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
| Exceeds Limits | ❌ FAILURE |
➖ NOT_ATTEMPTED |
429 |
||
✅ SUCCESS |
❌ FAILURE |
429 |
|||
ALLOW_FAILURE |
DO_NOTHING |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
409 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
| Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
N/A | ||
❌ FAILURE |
❌ FAILURE |
N/A | |||
❌ FAILURE |
✅ SUCCESS |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
N/A | |||
CANCEL_ONLY |
Within Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
|
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
409 |
|||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
| Exceeds Limits | ✅ SUCCESS |
✅ SUCCESS |
200 |
||
❌ FAILURE |
❌ FAILURE |
400 |
|||
❌ FAILURE |
✅ SUCCESS |
N/A | |||
✅ SUCCESS |
❌ FAILURE |
409 |
|||
Notes:
If both cancelOrderId and cancelOrigClientOrderId parameters are provided, the cancelOrderId is searched first, then the cancelOrigClientOrderId from that result is checked against that order. If both conditions are not met the request will be rejected.
cancelNewClientOrderId will replace clientOrderId of the canceled order, freeing it up for new orders.
newClientOrderId specifies clientOrderId value for the placed order.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
The new order can reuse old clientOrderId of the canceled order.
This cancel-replace operation is not transactional.
If one operation succeeds but the other one fails, the successful operation is still executed.
For example, in STOP_ON_FAILURE mode, if the new order placement fails, the old order is still canceled.
Filters and order count limits are evaluated before cancellation and order placement occurs.
If new order placement is not attempted, your order count is still incremented.
Like order.cancel, if you cancel an individual order from an order list, the entire order list is canceled.
The performance for canceling an order (single cancel or as part of a cancel-replace) is always better when only orderId is sent. Sending origClientOrderId or both orderId + origClientOrderId will be slower.
Request parameters.
Cancel an active order list.
Weight(IP): 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Notes:
If both orderListId and listClientOrderId parameters are provided, the orderListId is searched first, then the listClientOrderId from that result is checked against that order. If both conditions are not met the request will be rejected.
Canceling an individual order with order.cancel will cancel the entire order list as well.
Request parameters.
Send in a new one-cancels-the-other (OCO) pair:
LIMIT_MAKER + STOP_LOSS/STOP_LOSS_LIMIT orders (called legs),
where activation of one order immediately cancels the other.
This adds 1 order to EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Notes:
listClientOrderId parameter specifies listClientOrderId for the OCO pair.
A new OCO with the same listClientOrderId is accepted only when the previous one is filled or completely expired.
listClientOrderId is distinct from clientOrderId of individual orders.
limitClientOrderId and stopClientOrderId specify clientOrderId values for both legs of the OCO.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
Price restrictions on the legs:
side |
Price relation |
|---|---|
BUY |
price < market price < stopPrice |
SELL |
price > market price > stopPrice |
Both legs have the same quantity.
However, you can set different iceberg quantity for individual legs.
If stopIcebergQty is used, stopLimitTimeInForce must be GTC.
trailingDelta applies only to the STOP_LOSS/STOP_LOSS_LIMIT leg of the OCO.
Request parameters.
Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.
An OCO has 2 orders called the above order and below order.
One of the orders must be a LIMIT_MAKER/TAKE_PROFIT/TAKE_PROFIT_LIMIT order and the other must be
STOP_LOSS or STOP_LOSS_LIMIT order.
Price restrictions:
If the OCO is on the SELL side:
LIMIT_MAKER/TAKE_PROFIT_LIMIT price > Last Traded Price > STOP_LOSS/STOP_LOSS_LIMIT
stopPrice
TAKE_PROFIT stopPrice > Last Traded Price > STOP_LOSS/STOP_LOSS_LIMIT stopPrice
If the OCO is on the BUY side:
LIMIT_MAKER price < Last Traded Price < STOP_LOSS/STOP_LOSS_LIMIT stopPrice
TAKE_PROFIT stopPrice > Last Traded Price > STOP_LOSS/STOP_LOSS_LIMIT stopPrice
OCOs add 2 orders to the EXCHANGE_MAX_ORDERS filter and MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source:* Matching Engine
Request parameters.
Place an OPO.
OPOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source:* Matching Engine
Request parameters.
Place an OPOCO.
Weight(IP): 1
Unfilled Order Count: 3
Security Type: TRADE
Notes: Data Source:* Matching Engine
Request parameters.
Places an OTO.
An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the
working order goes on the order book.
The second order is called the pending order. It can be any order type except for MARKET orders using
parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets
fully filled*.
If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
When the order list is placed, if the working order gets immediately fully filled, the placement response
will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to
query the status of the pending order again to see its updated status.
OTOs add 2 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 2
Security Type: TRADE
Notes: Data Source:* Matching Engine
Mandatory parameters based on pendingType or workingType*
Depending on the pendingType or workingType, some optional parameters will become mandatory.
| Type | Additional mandatory parameters | Additional information |
|---|---|---|
workingType = LIMIT |
workingTimeInForce |
|
pendingType = LIMIT |
pendingPrice, pendingTimeInForce |
|
pendingType = STOP_LOSS or TAKE_PROFIT |
pendingStopPrice and/or pendingTrailingDelta |
|
pendingType =STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT |
pendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce |
Request parameters.
Place an OTOCO.
An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
The behavior of the working order is the same as the OTO.
OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
The rules of the pending above and pending below follow the same rules as the Order list OCO.
OTOCOs add 3 orders to the EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 3
Security Type: TRADE
Notes: Data Source:* Matching Engine
Mandatory parameters based on pendingAboveType, pendingBelowType or workingType*
Depending on the pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory.
| Type | Additional mandatory parameters | Additional information |
|---|---|---|
workingType = LIMIT |
workingTimeInForce |
|
pendingAboveType= LIMIT_MAKER |
pendingAbovePrice |
|
pendingAboveType = STOP_LOSS/TAKE_PROFIT |
pendingAboveStopPrice and/or pendingAboveTrailingDelta |
|
pendingAboveType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT |
pendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce |
|
pendingBelowType= LIMIT_MAKER |
pendingBelowPrice |
|
pendingBelowType= STOP_LOSS/TAKE_PROFIT |
pendingBelowStopPrice and/or pendingBelowTrailingDelta |
|
pendingBelowType=STOP_LOSS_LIMIT/TAKE_PROFIT_LIMIT |
pendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce |
Request parameters.
Send in a new order.
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Certain parameters (*) become mandatory based on the order type:
Order type |
Mandatory parameters |
|---|---|
LIMIT |
|
LIMIT_MAKER |
|
MARKET |
|
STOP_LOSS |
|
STOP_LOSS_LIMIT |
|
TAKE_PROFIT |
|
TAKE_PROFIT_LIMIT |
|
Supported order types:
Order type |
Description |
|---|---|
LIMIT |
Buy or sell |
LIMIT_MAKER |
This order type is also known as a POST-ONLY order. |
MARKET |
Buy or sell at the best available market price.
|
STOP_LOSS |
Execute a
I.e., when |
STOP_LOSS_LIMIT |
Place a |
TAKE_PROFIT |
Like |
TAKE_PROFIT_LIMIT |
Like |
Notes on using parameters for Pegged Orders:
These parameters are allowed for LIMIT, LIMIT_MAKER, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT orders.
If pegPriceType is specified, price becomes optional. Otherwise, it is still mandatory.
pegPriceType=PRIMARY_PEG means the primary peg, that is the best price on the same side of the order book as your order.
pegPriceType=MARKET_PEG means the market peg, that is the best price on the opposite side of the order book from your order.
Use pegOffsetType and pegOffsetValue to request a price level other than the best one. These parameters must be specified together.
Available timeInForce options,
setting how long the order should be active before expiration:
| TIF | Description |
|---|---|
GTC |
Good 'til Canceled – the order will remain on the book until you cancel it, or the order is completely filled. |
IOC |
Immediate or Cancel – the order will be filled for as much as possible, the unfilled quantity immediately expires. |
FOK |
Fill or Kill – the order will expire unless it cannot be immediately filled for the entire quantity. |
Notes:
newClientOrderId specifies clientOrderId value for the order.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
Any LIMIT or LIMIT_MAKER order can be made into an iceberg order by specifying the icebergQty.
An order with an icebergQty must have timeInForce set to GTC.
Trigger order price rules for STOP_LOSS/TAKE_PROFIT orders:
stopPrice must be above market price: STOP_LOSS BUY, TAKE_PROFIT SELL
stopPrice must be below market price: STOP_LOSS SELL, TAKE_PROFIT BUY
MARKET orders using quoteOrderQty follow LOT_SIZE filter rules.
The order will execute a quantity that has notional value as close as possible to requested quoteOrderQty.
Request parameters.
Test order placement.
Validates new order parameters and verifies your signature but does not send the order into the matching engine.
Weight: | Condition | Request Weight |
| --- | --- |
| Without computeCommissionRates | 1 |
| With computeCommissionRates | 20 |
Security Type: TRADE
Notes: Data Source:* Memory
Request parameters.
Places an order using smart order routing (SOR).
This adds 1 order to the EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.
Read SOR FAQ to learn more.
Weight(IP): 1
Unfilled Order Count: 1
Security Type: TRADE
Notes: Data Source:* Matching Engine
Note:* sor.order.place only supports LIMIT and MARKET orders. quoteOrderQty is not supported.
Request parameters.
Test new order creation and signature/recvWindow using smart order routing (SOR). Creates and validates a new order but does not send it into the matching engine.
Weight: | Condition | Request Weight |
| --- | --- |
| Without computeCommissionRates | 1 |
| With computeCommissionRates | 20 |
Security Type: TRADE
Notes: Data Source:* Memory
Request parameters.
TradeApi - interface
TradeApi