From 654c7d0e8a4f7faa3dc805d11643588a27464ca9 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Tue, 27 Jun 2017 17:29:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=8F=AF=E8=83=BD=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=9F=90=E4=BA=9B=E6=9C=9F=E6=9D=83=E5=92=8C=E4=BB=B7?= =?UTF-8?q?=E5=B7=AE=E8=A1=8C=E6=83=85Tick=E4=B8=A2=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/ctpGateway/ctpGateway.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vnpy/trader/gateway/ctpGateway/ctpGateway.py b/vnpy/trader/gateway/ctpGateway/ctpGateway.py index 2294cd21..4354080b 100644 --- a/vnpy/trader/gateway/ctpGateway/ctpGateway.py +++ b/vnpy/trader/gateway/ctpGateway/ctpGateway.py @@ -329,10 +329,6 @@ class CtpMdApi(MdApi): #---------------------------------------------------------------------- def onRtnDepthMarketData(self, data): """行情推送""" - # 忽略成交量为0的无效tick数据 - if not data['Volume']: - return - # 创建对象 tick = VtTickData() tick.gatewayName = self.gatewayName @@ -710,7 +706,7 @@ class CtpTdApi(TdApi): pos.positionProfit += data['PositionProfit'] # 计算持仓均价 - if pos.position: + if pos.position and pos.symbol in self.symbolSizeDict: size = self.symbolSizeDict[pos.symbol] pos.price = (cost + data['PositionCost']) / (pos.position * size)