From 553c4ac8589f7798f95742da8173fa9598240610 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 13 Nov 2019 09:52:46 +0800 Subject: [PATCH] [Fix] bug in on_order of BitmexGateway --- vnpy/gateway/bitmex/bitmex_gateway.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/vnpy/gateway/bitmex/bitmex_gateway.py b/vnpy/gateway/bitmex/bitmex_gateway.py index b089e380..7cd8c709 100644 --- a/vnpy/gateway/bitmex/bitmex_gateway.py +++ b/vnpy/gateway/bitmex/bitmex_gateway.py @@ -707,14 +707,15 @@ class BitmexWebsocketApi(WebsocketClient): if "ordStatus" not in d: return - side = d.get("side", "") - if not side: - return - # Update local order data sysid = d["orderID"] order = self.orders.get(sysid, None) if not order: + # Filter data with no trading side info + side = d.get("side", "") + if not side: + return + if d["clOrdID"]: orderid = d["clOrdID"] else: