Skip to content

Commit

Permalink
在CTP接口层添加对无效数据的过滤
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxy123 committed Mar 10, 2017
1 parent 65b8551 commit 1517117
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vn.trader/ctpGateway/ctpGateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ def onRspUnSubMarketData(self, data, error, n, last):
#----------------------------------------------------------------------
def onRtnDepthMarketData(self, data):
"""行情推送"""
# 忽略成交量为0的无效tick数据
if not data['Volume']:
return

# 创建对象
tick = VtTickData()
tick.gatewayName = self.gatewayName

Expand Down

0 comments on commit 1517117

Please sign in to comment.