资源加载中... loading...

币安合约策略问题

Author: VIC, Created: 2021-02-02 13:09:37, Updated:

每天运行一段时间,大概10个小时,之后就会出现无法查询订单的问题,第二天就恢复正常了,求大神解答什么原因。用的API接口,是接口被限制了吗,怎么能确认这个问题啊


More

小草 具体什么错误,api出问题是非常常见的错误

VIC function kaiduo(symbol, PRI, shoushu) { var duodan = exchange.IO("api", "POST", "/fapi/v1/order", "symbol=" + symbol + "&side=BUY&type=LIMIT&quantity=" + shoushu + "&price=" + PRI + "&timeInForce=GTC&timestamp=_D") while (duodan == null) { Log('30下单失败,出错!!'); duodan = exchange.IO("api", "POST", "/fapi/v1/order", "symbol=" + symbol + "&side=BUY&type=LIMIT&quantity=" + shoushu + "&price=" + PRI + "&timeInForce=GTC&timestamp=_D"); } B_orders.push(duodan.orderId) return B_orders } 上面是下单的语句,但是到后面用订单ID查询订单的时候返回错误。下面是查询的函数。而且运行几个小时都没问题,只要出问题,今天剩下的时间就肯定一直不好用 for (i = 0; i < B_orders.length; i++) { Sleep(100) var B_ordered = exchange.IO("api", "GET", "/fapi/v1/order", "symbol=" + duofang + "&orderId=" + B_orders[i] + "&timestamp=_D") while (B_ordered == null) { Log('71查单失败,出错!!'); B_ordered = exchange.IO("api", "GET", "/fapi/v1/order", "symbol=" + duofang + "&orderId=" + B_orders[i] + "&timestamp=_D") }