在 调试工具 https://www.fmz.com/m/debug
尝试了各种方式,使用币安合约batchOrders API 下订单,均失败
按照 下面搜索到的讨论内容构造url 依然失败
https://github.com/ccxt/ccxt/issues/6805
function main() {
exchange.SetContractType('swap')
var makeOrders = [
{"symbol":"BTCUSDT","side":"BUY","type":"MARKET","quantity":0.002},
{"symbol":"LTCUSDT","side":"BUY","type":"MARKET","quantity":0.002}
]
params = []
for (var i = 0; i < makeOrders.length; i++) {params.push(encodeURI(JSON.stringify(makeOrders[i])))}
params = "batchOrders=["+params.join(",")+"]"
Log(params)
var allOrders = exchange.IO('api', 'POST', '/fapi/v1/batchOrders',params);
Log(allOrders)
}
提示:信息 [{“code”:400,“msg”:null},{“code”:400,“msg”:null}]
按照 https://www.fmz.com/api 内 exchange.IO 的说明 依然失败
function main() {
exchange.SetContractType('swap')
var makeOrders = {
"batchOrders":[
{"symbol":"BTCUSDT", "side":"BUY" , "positionSide":"LONG" , "type":"MARKET", "quantity":0.001},
{"symbol":"BTCUSDT","side":"SELL","positionSide":"SHORT","type":"MARKET","quantity":0.001}
]
}
var allOrders = exchange.IO('api', 'POST', '/fapi/v1/batchOrders',"",JSON.stringify(makeOrders));
Log(allOrders)
}
提示: Futures_Binance 错误 Futures_OP 4: 400: {“timestamp”:1589196850717,“path”:“/fapi/v1/batchOrders”,“msg”:“System error”}
有人币安合约batchOrders API问题,以及应该如何构造params么
谢谢