[bug fix] 指数合约vt_symbol修复

This commit is contained in:
msincenselee 2020-02-12 11:15:02 +08:00
parent 9f05e5144a
commit 263e226c95

View File

@ -846,6 +846,7 @@ class CtpTdApi(TdApi):
idx_contract = deepcopy(contract) idx_contract = deepcopy(contract)
idx_contract.symbol = '{}99'.format(underlying_symbol) idx_contract.symbol = '{}99'.format(underlying_symbol)
idx_contract.name = u'{}指数'.format(underlying_symbol) idx_contract.name = u'{}指数'.format(underlying_symbol)
idx_contract.vt_symbol = f'{idx_contract.symbol}.{idx_contract.exchange.value}'
self.gateway.on_contract(idx_contract) self.gateway.on_contract(idx_contract)
# 获取data/tdx/future_contracts.json中的合约记录 # 获取data/tdx/future_contracts.json中的合约记录