Merge pull request #780 from tesla1060/master

sec api onRsp*QryPosition 返回的exchangeID是 ‘SH’形式的,需要用exchangeMapReverse转回
This commit is contained in:
vn.py 2018-03-14 09:02:07 +08:00 committed by GitHub
commit a555908833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -804,7 +804,7 @@ class SecTdApi(TdApi):
# 保存代码 # 保存代码
pos.symbol = data['securityID'] pos.symbol = data['securityID']
pos.exchange = exchangeMap.get(data['exchangeID'], EXCHANGE_UNKNOWN) pos.exchange = exchangeMapReverse.get(data['exchangeID'], EXCHANGE_UNKNOWN)
pos.vtSymbol = '.'.join([pos.symbol, pos.exchange]) pos.vtSymbol = '.'.join([pos.symbol, pos.exchange])
pos.direction = DIRECTION_LONG pos.direction = DIRECTION_LONG
pos.vtPositionName = '.'.join([pos.vtSymbol, pos.direction]) pos.vtPositionName = '.'.join([pos.vtSymbol, pos.direction])
@ -1152,7 +1152,7 @@ class SecTdApi(TdApi):
# 保存代码 # 保存代码
pos.symbol = data['securityOptionID'] pos.symbol = data['securityOptionID']
pos.exchange = exchangeMap.get(data['exchangeID'], EXCHANGE_UNKNOWN) pos.exchange = exchangeMapReverse.get(data['exchangeID'], EXCHANGE_UNKNOWN)
pos.vtSymbol = '.'.join([pos.symbol, pos.exchange]) pos.vtSymbol = '.'.join([pos.symbol, pos.exchange])
pos.direction = directionMapReverse.get(data['entrustDirection'], DIRECTION_UNKNOWN) pos.direction = directionMapReverse.get(data['entrustDirection'], DIRECTION_UNKNOWN)
pos.vtPositionName = '.'.join([pos.vtSymbol, pos.direction]) pos.vtPositionName = '.'.join([pos.vtSymbol, pos.direction])