hbdmapi / huobi_futures_Python

An Asynchronous Event-driven High-frequency Trading System,huobi future,huobi coin margined swap, huobi usdt margined swap included.
MIT License
267 stars 113 forks source link

执行取消订单报错 #23

Closed Lxtluck closed 4 years ago

Lxtluck commented 4 years ago

E [2020-08-07 07:08:54,277] Task exception was never retrieved future: <Task finished coro=<MyStrategy.on_ticker() done, defined at /code/examples/huobi_future/strategy.py:107> exception=AttributeError("'HuobiFutureTrade' object has no attribute '_orders'")> Traceback (most recent call last): File "/code/examples/huobi_future/strategy.py", line 118, in on_ticker await self.cancel_orders() File "/code/examples/huobi_future/strategy.py", line 124, in cancel_orders order_nos = [ orderno for orderno in self.trader.orders ] File "/usr/local/lib/python3.7/site-packages/alpha/trade.py", line 90, in orders return self._t.orders File "/usr/local/lib/python3.7/site-packages/alpha/platforms/huobi_future_trade.py", line 134, in orders return copy.copy(self._orders) AttributeError: 'HuobiFutureTrade' object has no attribute '_orders'

foonsun commented 4 years ago

上面错误,首先要配置config.json文件的access_key和secret_key,然后保存后再重试运行;

Lxtluck commented 4 years ago

已经填过了,kline可以正常订阅

foonsun commented 4 years ago

本地测试了是可以的,上面错误是不是一开始出现的,后面就没有了?

Lxtluck commented 4 years ago

今天试了下 又没问题了 什么原因?

foonsun commented 4 years ago

没有做更新,如果api-key错误,也会有上面的问题;