From 003f95156976e7d9faa7253ae0030085e17606f5 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 27 Oct 2017 16:29:07 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=E4=BF=AE=E5=A4=8D=E5=AF=8C=E9=80=94?= =?UTF-8?q?=E8=AF=81=E5=88=B8=E6=8E=A5=E5=8F=A3=E6=8C=81=E4=BB=93=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=97=B6=E5=B7=B2=E5=B9=B3=E4=BB=93=E5=90=88=E7=BA=A6?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/futuGateway/futuGateway.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vnpy/trader/gateway/futuGateway/futuGateway.py b/vnpy/trader/gateway/futuGateway/futuGateway.py index 26071d60..14cd2209 100644 --- a/vnpy/trader/gateway/futuGateway/futuGateway.py +++ b/vnpy/trader/gateway/futuGateway/futuGateway.py @@ -324,6 +324,9 @@ class FutuGateway(VtGateway): pos.positionProfit = float(row['pl_val']) pos.frozen = int(row['qty']) - int(row['can_sell_qty']) + if pos.price < 0: pos.price = 0 + if pos.positionProfit > 100000000: pos.positionProfit = 0 + self.onPosition(pos) #----------------------------------------------------------------------