diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 3eff9846..3a8dcc47 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -65,6 +65,8 @@ productClassMap[PRODUCT_FUTURES] = defineDict["THOST_FTDC_PC_Futures"] productClassMap[PRODUCT_OPTION] = defineDict["THOST_FTDC_PC_Options"] productClassMap[PRODUCT_COMBINATION] = defineDict["THOST_FTDC_PC_Combination"] productClassMapReverse = {v:k for k,v in productClassMap.items()} +productClassMapReverse[defineDict["THOST_FTDC_PC_ETFOption"]] = PRODUCT_OPTION +productClassMapReverse[defineDict["THOST_FTDC_PC_Stock"]] = PRODUCT_EQUITY # 委托状态映射 statusMap = {} @@ -827,8 +829,8 @@ class CtpTdApi(TdApi): contract.priceTick = data['PriceTick'] contract.strikePrice = data['StrikePrice'] contract.underlyingSymbol = data['UnderlyingInstrID'] - contract.productClass = productClassMapReverse.get(data['ProductClass'], PRODUCT_UNKNOWN) + contract.expiryDate = data['ExpireDate'] # 期权类型 if contract.productClass is PRODUCT_OPTION: diff --git a/vnpy/trader/gateway/secGateway/secGateway.py b/vnpy/trader/gateway/secGateway/secGateway.py index c1f3f005..deae0611 100644 --- a/vnpy/trader/gateway/secGateway/secGateway.py +++ b/vnpy/trader/gateway/secGateway/secGateway.py @@ -398,7 +398,7 @@ class SecMdApi(MdApi): tick.lastPrice = data['latestPrice'] tick.volume = data['tradeQty'] tick.time = data['updateTime'] - tick.date = data['tradingDay'] + tick.date = str(data['tradingDay']) tick.openPrice = data['openPrice'] tick.highPrice = data['highestPrice'] @@ -448,7 +448,7 @@ class SecMdApi(MdApi): tick.volume = data['tradeQty'] tick.openInterest = data['positionQty'] tick.time = data['updateTime'] - tick.date = data['tradingDay'] + tick.date = str(data['tradingDay']) tick.openPrice = data['openPrice'] tick.highPrice = data['highestPrice']