From 704ef3a78d2ddf4f202de69d0f051c8221f22480 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 5 Sep 2017 20:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85rsEngine=E7=9A=84stop?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BF=AE=E5=A4=8DctpGateway?= =?UTF-8?q?=E5=85=B3=E4=BA=8E=E6=9C=9F=E6=9D=83=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/rpcService/rsEngine.py | 2 +- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/vnpy/trader/app/rpcService/rsEngine.py b/vnpy/trader/app/rpcService/rsEngine.py index 5340bec1..04faf346 100644 --- a/vnpy/trader/app/rpcService/rsEngine.py +++ b/vnpy/trader/app/rpcService/rsEngine.py @@ -88,6 +88,6 @@ class RsEngine(object): #---------------------------------------------------------------------- def stop(self): """停止""" - pass + self.server.stop() \ No newline at end of file diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index c218c289..cd5ad269 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -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