0
Follow
0
Followers
Concernant la question de passer une commande de remplacement après une commande échouée. S'il n'y a pas suffisamment de fonds, null peut être renvoyé, et s'il y a un problème de réseau, undefined peu...
Created 2015-11-03 08:51:35 Updated 2015-11-03 08:56:21
2
2279
Le code de la commande suivante est le suivant: var id = 0; id = exchange.Buy(25, 0.1); if ((typeof(id) == 'undefined') alors id === null) { Log(' la commande suivante a échoué '); id = exchange.Buy(25, 0.1); }
Related Recommendations
Comment
All comments (2)
有重复下单的可能, 比如有这么一种情况, 你要请求下单的数据包已经发给交易所了,交易所已经执行了,但在订单数据返回的时候,发生了网络错误,比如超时之类的, 策略就会调用失败, 这时的处理办法就是,检测账户余额, 与下单前是否一致,如果不一致,说明订单成功下发了
11 years ago
下单的代码如下: var id = 0; id = exchange.Buy(25, 0.1); if ((typeof(id) == 'undefined') || id === null) { Log('下单失败'); id = exchange.Buy(25, 0.1); }
11 years ago
- 1
