11
Follow
6
Followers
我现在是在轮巡过程中用
var now = new Date().getTime();
if(now%28800000 > 28790000 || now%28800000 < 300000) {
Sleep(300000);
}
来实现的。
自己感觉这个办法笨笨的,而且策略在运行的过程中每秒钟轮巡2-5次,每天为这3次结算要白白执行这两行代码多少次啊好浪费。
而火币官方文档说的是:
“(1)在结算时不能下单和撤单,若用户在结算时下单或撤单会返回错误码"1056",提示结算中无法下单和撤单。 建议您在结算时间点每隔几秒钟轮询获取合约信息接口:linear-swap-api/v1/swap_contract_info,当返回报文中contract_status返回状态码为5、6、7、8中的任意一个数字时表示在结算中,当contract_status返回状态码为1时是表示结算完成可以正常下单和撤单。”
那我每次轮巡去调用接口信息,是不是效率更低呢。
所以来这里请教大家,有没有什么更好的办法。
Related Recommendations
How to Specify Different Versions of Data for the Rented Strategy by Its Rental Code MetadataAdvanced Tutorial for FMZ Quant platform Strategy WritingElementary Tutorial for FMZ Quant platform Strategy WritingGet Started with FMZ Quant PlatformSECURITY BUGI keep getting error: Exchange_GetAccount: Invalid ContractTypeWe have an incredibly profitable market making algorithm for sideways markets on Bitmex - but need expert to help eliminate wait times during downward volatility in the marketError with deribitLimitations of the backtesting engineHow to install ta-lib on linux docker?

