From f7db834e8b565c3880126f04aca9c5d3ac828526 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 11 Apr 2019 09:19:12 +0800 Subject: [PATCH] [Mod]change key used for get_order --- vnpy/gateway/okex/okex_gateway.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vnpy/gateway/okex/okex_gateway.py b/vnpy/gateway/okex/okex_gateway.py index 9ca18217..e4376f65 100644 --- a/vnpy/gateway/okex/okex_gateway.py +++ b/vnpy/gateway/okex/okex_gateway.py @@ -132,12 +132,12 @@ class OkexGateway(BaseGateway): def on_order(self, order: OrderData): """""" - self.orders[order.vt_orderid] = order + self.orders[order.orderid] = order super().on_order(order) - def get_order(self, vt_orderid: str): + def get_order(self, orderid: str): """""" - return self.orders.get(vt_orderid, None) + return self.orders.get(orderid, None) class OkexRestApi(RestClient): @@ -422,7 +422,7 @@ class OkexRestApi(RestClient): def on_cancel_order_failed(self, status_code: int, request: Request): """If cancel failed, mark order status to be rejected.""" req = request.extra - order = self.gateway.get_order(req.vt_orderid) + order = self.gateway.get_order(req.orderid) if order: order.status = Status.REJECTED self.gateway.on_order(order)