修改订单 (TRADE)
接口描述
修改订单功能,当前只支持限价(LIMIT)订单修改,修改后会在撮合队列里重新排序
方式
order.modify
请求
{
"id": "c8c271ba-de70-479e-870c-e64951c753d9",
"method": "order.modify",
"params": {
"apiKey": "HMOchcfiT9ZRZnhjp2XjGXhsOBd6msAhKz9joQaWwZ7arcJTlD2hGPHQj1lGdTjR",
"orderId": 328971409,
"origType": "LIMIT",
"positionSide": "SHORT",
"price": "43769.1",
"priceMatch": "NONE",
"quantity": "0.11",
"side": "SELL",
"symbol": "BTCUSDT",
"timestamp": 1703426755754,
"signature": "d30c9f0736a307f5a9988d4a40b688662d18324b17367d51421da5484e835923"
}
}
请求权重
10s order rate limit(X-MBX-ORDER-COUNT-10S)为1 1min order rate limit(X-MBX-ORDER-COUNT-1M)为1 IP rate limit(x-mbx-used-weight-1m)为1
请求参数
名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
orderId | LONG | NO | 系统订单号 |
origClientOrderId | STRING | NO | 用户自定义的订单号 |
symbol | STRING | YES | 交易对 |
side | ENUM | YES | 买卖方向 SELL , BUY |
quantity | DECIMAL | YES | 下单数量,使用closePosition 不支持此参数。 |
price | DECIMAL | YES | 委托价格 |
priceMatch | ENUM | NO | OPPONENT / OPPONENT_5 / OPPONENT_10 / OPPONENT_20 /QUEUE / QUEUE_5 / QUEUE_10 / QUEUE_20 ;不能与price同时传 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
orderId
与origClientOrderId
必须至少发送一个,同时发送则以 order id为准quantity
与price
均必须发送,这点和 dapi 修改订单不同- 当新订单的
quantity
或price
不满足PRICE_FILTER / PERCENT_FILTER / LOT_SIZE限制,修改会被拒绝,原订单依旧被保留- 订单会在下列情况下被取消:
- 原订单被部分执行且新订单
quantity
<=executedQty
- 原订单是
GTX
,新订单的价格会导致订单立刻执行- 同一订单修改次数最多10000次
响应示例
{
"id": "c8c271ba-de70-479e-870c-e64951c753d9",
"status": 200,
"result": {
"orderId": 328971409,
"symbol": "BTCUSDT",
"status": "NEW",
"clientOrderId": "xGHfltUMExx0TbQstQQfRX",
"price": "43769.10",
"avgPrice": "0.00",
"origQty": "0.110",
"executedQty": "0.000",
"cumQty": "0.000",
"cumQuote": "0.00000",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"closePosition": false,
"side": "SELL",
"positionSide": "SHORT",
"stopPrice": "0.00",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"priceMatch": "NONE",
"selfTradePreventionMode": "NONE",
"goodTillDate": 0,
"updateTime": 1703426756190
},
"rateLimits": [
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 300,
"count": 1
},
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 1200,
"count": 1
},
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 2400,
"count": 1
}
]
}