From e8443079875d2fd031f14e13ea28c72d0ecc6e2e Mon Sep 17 00:00:00 2001 From: msincenselee Date: Fri, 19 May 2017 11:49:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=9D=E5=AD=98=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/ctaStrategy/ctaBacktesting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vn.trader/ctaStrategy/ctaBacktesting.py b/vn.trader/ctaStrategy/ctaBacktesting.py index 2a6230c5..b2256b69 100644 --- a/vn.trader/ctaStrategy/ctaBacktesting.py +++ b/vn.trader/ctaStrategy/ctaBacktesting.py @@ -2955,7 +2955,12 @@ class BacktestingEngine(object): """ plt.tight_layout() #plt.xticks(xindex, tradeTimeIndex, rotation=30) # 旋转15 - + + fig_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), 'TestLogs', + 'Fig_{0}.png'.format( + datetime.now().strftime('%Y%m%d_%H%M')))) + fig = plt.gcf() + fig.savefig(fig_file_name) plt.show() #----------------------------------------------------------------------