From 3e033a9aff4bf865790d6fde7a4da99953980b17 Mon Sep 17 00:00:00 2001 From: msincenselee Date: Thu, 20 Apr 2017 20:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A5=97=E5=88=A9=E5=9B=9E?= =?UTF-8?q?=E6=B5=8B=E7=9A=84=E8=AE=A1=E7=AE=97bug=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=AF=8F=E6=97=A5=E5=87=80=E5=80=BC=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=AF=BC=E5=87=BA=E3=80=82=EF=BC=88=E6=9A=82=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=BB=93=E7=AE=97=E4=BB=B7=E7=9A=84=E5=87=80?= =?UTF-8?q?=E5=80=BC=E8=AE=B0=E8=BF=87=E8=AE=A1=E7=AE=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ctaAlgo/ctaBacktesting.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vn.trader/ctaAlgo/ctaBacktesting.py b/vn.trader/ctaAlgo/ctaBacktesting.py index 7835d9e3..20c65bb4 100644 --- a/vn.trader/ctaAlgo/ctaBacktesting.py +++ b/vn.trader/ctaAlgo/ctaBacktesting.py @@ -155,7 +155,6 @@ class BacktestingEngine(object): return self.capital, self.avaliable, self.percent, self.percentLimit - #---------------------------------------------------------------------- def setStartDate(self, startDate='20100416', initDays=10): """设置回测的启动日期""" @@ -1388,12 +1387,14 @@ class BacktestingEngine(object): """ self.strategy = strategyClass(self, setting) self.strategy.name = self.strategy.className + self.strategy.onInit() + self.strategy.onStart() #---------------------------------------------------------------------- def sendOrder(self, vtSymbol, orderType, price, volume, strategy): """发单""" - self.writeCtaLog(u'{0},{1},{2}@{3}'.format(vtSymbol,orderType,price,volume)) + self.writeCtaLog(u'{0},{1},{2}@{3}'.format(vtSymbol, orderType, price, volume)) self.limitOrderCount += 1 orderID = str(self.limitOrderCount) @@ -1458,8 +1459,6 @@ class BacktestingEngine(object): order.cancelTime = str(self.dt) del self.workingLimitOrderDict[vtOrderID] - - #---------------------------------------------------------------------- def sendStopOrder(self, vtSymbol, orderType, price, volume, strategy): """发停止单(本地实现)"""