From 61dfdeea387f91af41adc0ecf32e7495c5093e52 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 30 Aug 2017 21:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A3=8E=E6=8E=A7=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=AF=B9=E6=95=B0=E9=87=8F=E4=B8=BA0=E5=A7=94?= =?UTF-8?q?=E6=89=98=E7=9A=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/riskManager/rmEngine.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vnpy/trader/app/riskManager/rmEngine.py b/vnpy/trader/app/riskManager/rmEngine.py index 8816f2b0..a77dc1e9 100644 --- a/vnpy/trader/app/riskManager/rmEngine.py +++ b/vnpy/trader/app/riskManager/rmEngine.py @@ -166,6 +166,10 @@ class RmEngine(object): return True # 检查委托数量 + if orderReq.volume <= 0: + self.writeRiskLog(u'委托数量必须大于0') + return False + if orderReq.volume > self.orderSizeLimit: self.writeRiskLog(u'单笔委托数量%s,超过限制%s' %(orderReq.volume, self.orderSizeLimit))