From 5f7cc9b70747ad2c00e5b5cbd4bf3e28b2aec4e8 Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Sun, 31 Jul 2016 21:41:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=8B=E5=89=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=AF=AF=E5=88=A0=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ctaAlgo/ctaBacktesting.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vn.trader/ctaAlgo/ctaBacktesting.py b/vn.trader/ctaAlgo/ctaBacktesting.py index fd9fe736..e51b74e0 100644 --- a/vn.trader/ctaAlgo/ctaBacktesting.py +++ b/vn.trader/ctaAlgo/ctaBacktesting.py @@ -563,6 +563,11 @@ class BacktestingEngine(object): capitalList = [] # 盈亏汇总的时间序列 drawdownList = [] # 回撤的时间序列 + winningResult = 0 # 盈利次数 + losingResult = 0 # 亏损次数 + totalWinning = 0 # 总盈利金额 + totalLosing = 0 # 总亏损金额 + for result in resultList: capital += result.pnl maxCapital = max(capital, maxCapital)