From b7c060e226631aef0beecf12033f0fbf76835711 Mon Sep 17 00:00:00 2001 From: vnpy Date: Tue, 3 May 2016 22:38:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A3=8E=E6=8E=A7=E7=9A=84bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/vtEngine.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vn.trader/vtEngine.py b/vn.trader/vtEngine.py index df52d756..45b7e709 100644 --- a/vn.trader/vtEngine.py +++ b/vn.trader/vtEngine.py @@ -141,6 +141,10 @@ class MainEngine(object): #---------------------------------------------------------------------- def sendOrder(self, orderReq, gatewayName): """对特定接口发单""" + # 如果风控检查失败则不发单 + if not self.rmEngine.checkRisk(orderReq): + return '' + if gatewayName in self.gatewayDict: gateway = self.gatewayDict[gatewayName] return gateway.sendOrder(orderReq) @@ -150,10 +154,6 @@ class MainEngine(object): #---------------------------------------------------------------------- def cancelOrder(self, cancelOrderReq, gatewayName): """对特定接口撤单""" - # 如果风控检查失败则不发单 - if not self.rmEngine.checkRisk(orderReq): - return '' - if gatewayName in self.gatewayDict: gateway = self.gatewayDict[gatewayName] gateway.cancelOrder(cancelOrderReq)