vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 5
声望: 0

C:\vnstudio\python.exe C:/vnstudio/Project/vnpy2.2.0/run/run.py
[2021-05-07T19:21:05.219219]: Unhandled WebSocket Error:<class 'AttributeError'>
LastSentText:
{"jsonrpc": "2.0", "id": 11, "method": "private/subscribe", "params": {"channels": ["user.portfolio.btc", "user.portfolio.eth"], "access_token": "1651922464274.1JkSIumb.wObAhQrMtGGLvAbZ5bKAb1Zi0-RjsVTsR2Tk3TW6Mjjfdnz_yRqWRiwjza_puLAuQ5kKqMr-BJRbIQMUfwCk2V5sZGV6xecTdlqM5JZw-oWHsPz_O2OkFs7PtZc9pBFkDgLFJrRwZrij7wm68ebd6tvJ4KjuQAbRsy0xpFLrNZE8KV1EO09oHpBsOVdW6YBkD1L88AoTRU5fwYB0QQlVT6lCp5QpEf-XGSyZj-RoFex5YinXBbAN4"}}
LastReceivedText:
{"jsonrpc":"2.0","id":9,"result":[{"web":false,"time_in_force":"good_til_cancelled","replaced":false,"reduce_only":false,"profit_loss":0.0,"price":55000.0,"post_only":false,"order_type":"limit","order_state":"open","order_id":"30076479655","max_show":11000,"last_update_timestamp":1620360779376,"label":"","is_liquidation":false,"instrument_name":"BTC-PERPETUAL","filled_amount":0,"direction":"buy","creation_timestamp":1620360779376,"commission":0.0,"average_price":0.0,"app_name":"Bravo","api":true,"amount":11000}],"usIn":1620386464476818,"usOut":1620386464484745,"usDiff":7927,"testnet":false}
Exception trace:
Traceback (most recent call last):
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\api\websocket\websocket_client.py", line 216, in _run
self.on_packet(data)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 349, in on_packet
callback(packet)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 457, in on_query_order
self.on_order(d)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 539, in on_order
if data["price"].isdigit():
AttributeError: 'float' object has no attribute 'isdigit'
Traceback (most recent call last):
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\api\websocket\websocket_client.py", line 216, in _run
self.on_packet(data)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 349, in on_packet
callback(packet)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 457, in on_query_order
self.on_order(d)
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 539, in on_order
if data["price"].isdigit():
AttributeError: 'float' object has no attribute 'isdigit'

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

管理员、版主、大神们、麻烦看一下,几天前还能连上,这两天就不行了,用三台机子(2台win10,1台ubuntu)试了都一样,其它交易所能连上。

Member
avatar
加入于:
帖子: 3033
声望: 174

应该是接口升级了,可以把if data["price"].isdigit()改成if data["price"]试试

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

xiaohe wrote:

应该是接口升级了,可以把if data["price"].isdigit()改成if data["price"]试试
改了,有新问题:
C:\vnstudio\python.exe C:/vnstudio/Project/vnpy2.2.0/run/run.py
Traceback (most recent call last):
File "C:/vnstudio/Project/vnpy2.2.0/run/run.py", line 43, in <module>
from vnpy.gateway.deribit import DeribitGateway
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit__init__.py", line 1, in <module>
from .deribit_gateway import DeribitGateway
File "C:\vnstudio\Project\vnpy2.2.0\vnpy\gateway\deribit\deribit_gateway.py", line 539
if data["price"]
^
SyntaxError: invalid syntax

Process finished with exit code 1

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

不好意思,少了个冒号。连上了,谢谢!

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

沪公网安备 31011502017034号