跳到主要内容

修改订单 (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

请求参数

名称类型是否必需描述
orderIdLONGNO系统订单号
origClientOrderIdSTRINGNO用户自定义的订单号
symbolSTRINGYES交易对
sideENUMYES买卖方向 SELL, BUY
quantityDECIMALYES下单数量,使用closePosition不支持此参数。
priceDECIMALYES委托价格
priceMatchENUMNOOPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20;不能与price同时传
recvWindowLONGNO
timestampLONGYES
  • orderIdorigClientOrderId 必须至少发送一个,同时发送则以 order id为准
  • quantityprice 均必须发送,这点和 dapi 修改订单不同
  • 当新订单的quantityprice不满足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
}
]
}