__init_botvs__运行出错求版主看下

Author: sword10086, Created: 2017-12-01 15:25:39, Updated:

MAC平台 最新的托管版本 绑定了python版 Dual Thrust OKCoin 期货

(most recent call last): File “<string>”, line 1003, in init_botvs File “<string>”, line 240, in <module> File “<string>”, line 192, in main TypeError: object of type ‘bool’ has no len() Futures_OP 3: Post https://www.okex.com/api/v1/future_position_4fix.do: EOF
Traceback

ps:话说okex的future_position_4fix这个api一直请求失败,大家有建议吗~


More

sword10086 python2.7

小小梦 用 _C 处理下 GetPosition ,不过 访问不到接口 https://www.okex.com/api/v1/future_position_4fix.do: EOF 还是 OKEX 的问题 , 我一个服务器 可以访问到,一个不行,好像是 OK 屏蔽了一些 IP。

sword10086 建议做个容错?

小小梦 应该是 OKEX 屏蔽了一些 地区 的 IP 我用 我们本地的电脑 测试 https://dn-filebox.qbox.me/9678a48eade4d2ec36a65645ab791e5fde17120b.jpg 我用 华南的阿里云 测试 https://dn-filebox.qbox.me/a130c79c879a7eab56c8e74fe0ebb11e9d2eb8f2.jpg 华南的 就可以获取到持仓, 只不过 我没有持仓 所以是 空数组 [] 策略停止的原因就是这个 (most recent call last): File "<string>", line 1003, in init_botvs File "<string>", line 240, in <module> File "<string>", line 192, in main TypeError: object of type 'bool' has no len() Futures_OP 3: Post https://www.okex.com/api/v1/future_position_4fix.do: EOF Traceback 192行 ``` # Log("Fee:",exchange.GetFee()) if len(exchange.GetPosition()) > 0: raise Error_AtBeginHasPosition ``` 获取持仓信息 失败 然后对 布尔型 数据使用了 len() 函数,导致 异常。