跳到主要内容

批量修改订单(TRADE)

接口描述

批量修改订单

HTTP请求

PUT /fapi/v1/batchOrders

请求权重

10s order rate limit(X-MBX-ORDER-COUNT-10S)为5; 1min order rate limit(X-MBX-ORDER-COUNT-1M)为1; IP rate limit(x-mbx-used-weight-1m)为5;

请求参数

名称类型是否必需描述
batchOrderslist<JSON>YES订单列表,最多支持5个订单
recvWindowLONGNO
timestampLONGYES

其中batchOrders应以list of JSON格式填写订单参数

名称类型是否必需描述
orderIdLONGNO系统订单号,orderId 与 origClientOrderId 至少要传一个
origClientOrderIdSTRINGNO用户自定义的订单号,orderId 与 origClientOrderId 至少要传一个
symbolSTRINGYES交易对
sideENUMYES买卖方向 SELL, BUY
quantityDECIMALYES下单数量,使用closePosition不支持此参数。
priceDECIMALYES委托价格
priceMatchENUMNOOPPONENT/ OPPONENT_5/ OPPONENT_10/ OPPONENT_20/QUEUE/ QUEUE_5/ QUEUE_10/ QUEUE_20;不能与price同时传
stopPriceDECIMALNO触发价, 仅 STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET 需要此参数
recvWindowLONGNO
timestampLONGYES
  • 具体订单条件规则,与普通修改订单一致
  • 批量修改订单采取并发处理,不保证订单撮合顺序
  • 批量修改订单的返回内容顺序,与订单列表顺序一致
  • 同一订单修改次数最多10000次
  • 改单不支持设置selfTradePreventionMode并会将selfTradePreventionMode重置为NONE

响应示例

[
{
"orderId": 20072994037,
"symbol": "BTCUSDT",
"pair": "BTCUSDT",
"status": "NEW",
"clientOrderId": "LJ9R4QZDihCaS8UAOOLpgW",
"price": "30005",
"avgPrice": "0.0",
"origQty": "1",
"executedQty": "0",
"cumQty": "0",
"cumBase": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"reduceOnly": false,
"closePosition": false,
"side": "BUY",
"positionSide": "LONG",
"stopPrice": "0",
"workingType": "CONTRACT_PRICE",
"priceProtect": false,
"origType": "LIMIT",
"priceMatch": "NONE", //盘口价格下单模式
"selfTradePreventionMode": "NONE", //订单自成交保护模式
"goodTillDate": 0, //订单TIF为GTD时的自动取消时间
"updateTime": 1629182711600
},
{
"code": -2022,
"msg": "ReduceOnly Order is rejected."
}
]