补充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):
"""停止"""
pass
self.server.stop()

View File

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