补充rsEngine的stop方法,修复ctpGateway关于期权类型的映射问题

This commit is contained in:
vn.py 2017-09-05 20:54:29 +08:00
parent 7b2888200f
commit 704ef3a78d
2 changed files with 7 additions and 6 deletions

View File

@ -88,6 +88,6 @@ class RsEngine(object):
#---------------------------------------------------------------------- #----------------------------------------------------------------------
def stop(self): def stop(self):
"""停止""" """停止"""
pass self.server.stop()

View File

@ -804,10 +804,11 @@ class CtpTdApi(TdApi):
contract.productClass = productClassMapReverse.get(data['ProductClass'], PRODUCT_UNKNOWN) contract.productClass = productClassMapReverse.get(data['ProductClass'], PRODUCT_UNKNOWN)
# 期权类型 # 期权类型
if data['OptionsType'] == '1': if contract.productClass is PRODUCT_OPTION:
contract.optionType = OPTION_CALL if data['OptionsType'] == '1':
elif data['OptionsType'] == '2': contract.optionType = OPTION_CALL
contract.optionType = OPTION_PUT elif data['OptionsType'] == '2':
contract.optionType = OPTION_PUT
# 缓存代码和交易所的印射关系 # 缓存代码和交易所的印射关系
self.symbolExchangeDict[contract.symbol] = contract.exchange self.symbolExchangeDict[contract.symbol] = contract.exchange