veighna-global / vnpy_okx

OKX trading gateway for VeighNa Evo
MIT License
93 stars 78 forks source link

3.0运行时,AttributeError: OKEX #23

Closed ShitcardW closed 1 year ago

ShitcardW commented 2 years ago

完整报错如下,麻烦大神们帮帮忙,感谢

File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/run.py", line 5, in from vnpy_okex import OkexGateway File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/init.py", line 25, in from .okex_gateway import OkexGateway File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/okex_gateway.py", line 119, in class OkexGateway(BaseGateway): File "/Users/xiaofeiwang/Documents/Quant/vnpy_okex-main/vnpy_okex/okex_gateway.py", line 133, in OkexGateway exchanges: Exchange = [Exchange.OKEX] File "/Users/xiaofeiwang/opt/anaconda3/envs/py37_vnpy/lib/python3.9/enum.py", line 429, in getattr raise AttributeError(name) from None AttributeError: OKEX

tongjun741 commented 2 years ago

okex_gateway.py中所有的 Exchange.OKEX 改为 Exchange.OTC 即可,总共4处,如: exchanges: Exchange = [Exchange.OTC]

ShitcardW commented 2 years ago

但这个问题是我觉得是不是出现在vn.py的项目中,vnpy.trader.constant中constant这个文件里面的exchange类 没有更新数字货币相关的内容,需要在exchange类中加入OKEX = "OKEX"

这样改也可以行的通,OTC这边代表了什么做市商模式?我这样改对么?

xldistance commented 2 years ago

是在exchange类加入 OKEX = "OKEX",前面改的是错的

vn-crypto commented 1 year ago

check this #18