From 1517117b8e50447282487025fb7aff5bdfdd22b0 Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Fri, 10 Mar 2017 23:24:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8CTP=E6=8E=A5=E5=8F=A3=E5=B1=82?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E6=97=A0=E6=95=88=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ctpGateway/ctpGateway.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vn.trader/ctpGateway/ctpGateway.py b/vn.trader/ctpGateway/ctpGateway.py index 3d07c562..b76e2ba0 100644 --- a/vn.trader/ctpGateway/ctpGateway.py +++ b/vn.trader/ctpGateway/ctpGateway.py @@ -338,6 +338,11 @@ class CtpMdApi(MdApi): #---------------------------------------------------------------------- def onRtnDepthMarketData(self, data): """行情推送""" + # 忽略成交量为0的无效tick数据 + if not data['Volume']: + return + + # 创建对象 tick = VtTickData() tick.gatewayName = self.gatewayName