求助:GetRecords函数不稳定 & 如何导出实盘log

Author: churchillxy, Created: 2022-01-07 20:44:15, Updated: 2022-01-07 21:12:07

大家好,我有两个问题求助。谢谢啦

  1. 我使用Getrecords函数有时会报错(通常在运行在1-2天后报错),见下,请问怎么处理比较合适? 2022-01-07 20:19:00 错误 Traceback (most recent call last): File “<string>”, line 999, in init_ctx File “<string>”, line 321, in <module> File “<string>”, line 111, in main File “<string>”, line 11, in CompositeArray TypeError: object of type ‘NoneType’ has no len() 2022-01-07 20:19:00 Futures_OKCoin 错误 GetRecords: 502: <html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> </body> </html> <!– a padding to disable MSIE and Chrome friendly error page –> <!– a padding to disable MSIE and Chrome friendly error page –> <!– a padding to disable MSIE and Chrome friendly error page –> <!– a padding to disable MSIE and Chrome friendly error page –> <!– a padding to disable MSIE and Chrome friendly error page –> <!– a padding to disable MSIE and Chrome friendly error page –>

  2. 该如何导出实盘的log

非常感谢


More

小小梦 实盘日志都在托管者所在目录logs文件夹内,机器人ID是文件名,扩展名是db3。用SQLite数据库软件可以打开。 GetRecords报错是访问接口失败了, http502错误。网络问题或者交易所问题。

小小梦 对于获取行情的接口可以用_C,下单之类的不建议用。

churchillxy 你好,我看API文档里有_C(...)函数,可以用吗?谢谢

小小梦 您可以看下文库里的一些文章:https://www.fmz.com/digest-topic/6909 ,有些对容错的说明。

churchillxy 好的,谢谢。那如何让报错时不要中止实盘运行了?怎么样加上容错比较合理