vn.py量化社区
By Traders, For Traders.
Member
avatar
加入于:
帖子: 10
声望: 0

连接OKEX和OKEXF的rest_api时没有错误,但是连接websocket时会报错。VNStudio界面日志显示:
time msg gateway_name
25:49.5 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:48.9 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:48.4 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:47.8 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:47.3 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:46.7 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:45.7 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:45.1 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:44.6 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:44.4 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:43.5 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:42.9 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:42.4 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:41.8 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:41.3 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:37.9 触发异常,状态码:<class 'requests.exceptions.ProxyError'>,信息:HTTPSConnectionPool(host='www.okex.com', port=443): Max retries exceeded with url: /api/futures/v3/orders/BTC-USD-190719?status=1 (Caused by ProxyError('Cannot connect to proxy.', OSError("(10054, 'WSAECONNRESET')"))) OKEXF
25:37.7 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:37.3 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:36.8 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:36.4 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:35.9 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:35.5 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:35.6 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:34.6 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:34.2 请求失败,状态码:400,信息:{"code":30008,"message":"Request timestamp expired"} OKEXF
25:33.7 触发异常,状态码:<class 'AttributeError'>,信息:module 'websocket' has no attribute 'create_connection' OKEXF
25:33.7 合约信息查询成功 OKEXF
25:33.3 服务器时间:2019-07-08T06:26:50.344Z,本机时间:2019-07-08T06:25:33.277618 OKEXF
25:31.5 REST API启动成功 OKEXF

Administrator
avatar
加入于:
帖子: 1441
声望: 63

这是因为时间戳差距太远,请调整下本机时间,做个对时

Member
avatar
加入于:
帖子: 10
声望: 0

已解决,感谢!

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3