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

不知道是不是刚更新的版本里新出现的,如果有读不到郑商所数据的,请找到rqdata文件,做出如下修改:

在vnpy.trader里的rqdata里,
class RqdataClient:
def to_rq_symbol(self, symbol: str, exchange: Exchange) -> str:
"""
CZCE product of RQData has symbol like "TA1905" while
vt symbol is "TA905.CZCE" so need to add "1" in symbol.
"""

# Equity
if exchange in [Exchange.SSE, Exchange.SZSE]:
    if exchange == Exchange.SSE:
        rq_symbol = f"{symbol}.XSHG"
    else:
        rq_symbol = f"{symbol}.XSHE"
# Futures and Options
elif exchange in [Exchange.SHFE, Exchange.CFFEX, Exchange.DCE, Exchange.DCE, Exchange.INE]

其中最后一行有两个DCE,把其中一个改成CZCE

Administrator
avatar
加入于:
帖子: 4028
声望: 221

确实是个BUG,我们修复下

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