在CTP接口层添加对无效数据的过滤

This commit is contained in:
chenxy123 2017-03-10 23:24:24 +08:00
parent 65b8551677
commit 1517117b8e

View File

@ -338,6 +338,11 @@ class CtpMdApi(MdApi):
#----------------------------------------------------------------------
def onRtnDepthMarketData(self, data):
"""行情推送"""
# 忽略成交量为0的无效tick数据
if not data['Volume']:
return
# 创建对象
tick = VtTickData()
tick.gatewayName = self.gatewayName