From b53a286295652e815101314a3166acee18348ae5 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 7 Nov 2019 16:05:22 +0800 Subject: [PATCH] [Mod] use auxPrice for IB stop order, close #2100 --- vnpy/gateway/ib/ib_gateway.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vnpy/gateway/ib/ib_gateway.py b/vnpy/gateway/ib/ib_gateway.py index f3d36acd..10ee2603 100644 --- a/vnpy/gateway/ib/ib_gateway.py +++ b/vnpy/gateway/ib/ib_gateway.py @@ -392,11 +392,15 @@ class IbApi(EWrapper): type=ORDERTYPE_IB2VT[ib_order.orderType], orderid=orderid, direction=DIRECTION_IB2VT[ib_order.action], - price=ib_order.lmtPrice, volume=ib_order.totalQuantity, gateway_name=self.gateway_name, ) + if order.type == OrderType.LIMIT: + order.price = ib_order.lmtPrice + elif order.type == OrderType.STOP: + order.price = ib_order.auxPrice + self.orders[orderid] = order self.gateway.on_order(copy(order))