diff --git a/vnpy_binance/binance_spot_gateway.py b/vnpy_binance/binance_spot_gateway.py index 9692c1c..3735829 100644 --- a/vnpy_binance/binance_spot_gateway.py +++ b/vnpy_binance/binance_spot_gateway.py @@ -471,6 +471,10 @@ def on_query_account(self, data: dict, request: Request) -> None: def on_query_order(self, data: dict, request: Request) -> None: """未成交委托查询回报""" for d in data: + # 过滤不支持类型的委托 + if d["type"] not in ORDERTYPE_BINANCE2VT: + continue + order: OrderData = OrderData( orderid=d["clientOrderId"], symbol=d["symbol"].lower(), @@ -698,6 +702,10 @@ def on_account(self, packet: dict) -> None: def on_order(self, packet: dict) -> None: """委托更新推送""" + # 过滤不支持类型的委托 + if packet["o"] not in ORDERTYPE_BINANCE2VT: + return + if packet["C"] == "": orderid: str = packet["c"] else: