44 views
Skip to first unread message

Thomas Wiecki

unread,
Apr 21, 2016, 11:45:05 AM4/21/16
to zipline
We are pleased to announce the release of pyfolio 0.5.0. Available via our conda channel "quantopian" or via pypi.

What is it
=======

pyfolio is a Python library for performance and risk analysis of financial portfolios developed by Quantopian Inc. It works well with the Zipline open source backtesting library but can also be used stand-alone. 

At the core of pyfolio is a so-called tear sheet that consists of various individual plots that provide a comprehensive image of the performance of a trading algorithm. It includes all common risk metrics, like Sharpe ratio, alpha and beta, as well as more advanced Bayesian analyses.


Release notes
===========

This is a major release from 0.4.0 that includes many new analyses and features. We recommend that all users upgrade to this new version. Also update your dependencies, specifically, pandas>=0.18.0seaborn>=0.6.0 and zipline>=0.8.4.

New features

Bug fixes

  • Many depracation fixes for Pandas 0.18.0, seaborn 0.6.0, and zipline 0.8.4

Best,
Thomas

Xuchun Li

unread,
Nov 12, 2016, 12:30:05 AM11/12/16
to Zipline Python Opensource Backtester, 黄玲
Hi, 

How can I save the tear sheet results in local disk, such at all the images of the trading algorithm performance? Thanks.

Regards,
Xuchun

Thomas Wiecki

unread,
Nov 14, 2016, 3:44:48 AM11/14/16
to Xuchun Li, Zipline Python Opensource Backtester, 黄玲
Hi Xuchun,

import matplotlib.pyplot as plt
create_tear_sheet()
plt.savefig('mytear.png')

Should do the trick. This will probably just save the latest tear sheet created so you probably can't use create_full_tear_sheet().

HTH,
Thomas

--
You received this message because you are subscribed to the Google Groups "Zipline Python Opensource Backtester" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zipline+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xuchun Li

unread,
Nov 14, 2016, 8:03:35 AM11/14/16
to Thomas Wiecki, Zipline Python Opensource Backtester, 黄玲
Hi Thomas,

Thanks for the reply. 

I use below command to plot return chart.

import pyfolio as pf
pf.create_returns_tear_sheet(returns)
import matplotlib.pyplot as plt
plt.savefig('mytear.png')

But when I run the above code from my MAC terminal, it pop up a new window which shows the return chart. And never run the code plt.savefig('mytear.png') to save the file. If I close the pop up chart window, plt.savefig('mytear.png') save an empty file. How can I solve this problem?

Xuchun


Thomas Wiecki

unread,
Nov 14, 2016, 8:24:11 AM11/14/16
to Xuchun Li, Zipline Python Opensource Backtester, 黄玲
Alternatively, you can try:

fig = pf.create_returns_tear_sheet(returns, return_fig=True)
fig.save('mytear.png')

Xuchun Li

unread,
Nov 14, 2016, 9:33:32 AM11/14/16
to Thomas Wiecki, Zipline Python Opensource Backtester, 黄玲
This code has same problem. But I have figured out the solution as follows.

pf.plot_monthly_returns_dist(returns)
plt.savefig('monthly_returns_dist.png')
plt.close()

Thanks anyway. Do you know how to load local csv file for zipline backtest?

Xuchun
Reply all
Reply to author
Forward
0 new messages