[Add] filter for empty query trade/order data

This commit is contained in:
vn.py 2019-09-03 09:57:19 +08:00
parent 5e31db27b2
commit 238b59f112

View File

@ -454,6 +454,7 @@ class DaFutureApi(FutureApi):
""" """
Callback of order query. Callback of order query.
""" """
if data["TreatyCode"]:
order = OrderData( order = OrderData(
symbol=data["TreatyCode"], symbol=data["TreatyCode"],
exchange=EXCHANGE_DA2VT[data["ExchangeCode"]], exchange=EXCHANGE_DA2VT[data["ExchangeCode"]],
@ -482,6 +483,7 @@ class DaFutureApi(FutureApi):
""" """
Callback of trade query. Callback of trade query.
""" """
if data["TreatyCode"]:
self.update_trade(data) self.update_trade(data)
if last: if last: