Maintained

pyfolio-reloaded guide

pyfolio’s tear sheets became a standard format for presenting quant strategy results.

Last reviewed · Also known as pyfolio, empyrical-reloaded

Quick answer

pyfolio-reloaded continues Quantopian’s pyfolio for analysing strategy performance. From returns (and optionally positions and transactions) it builds tear sheets: cumulative returns, rolling Sharpe and beta, drawdown periods, exposures, turnover and round-trip trade statistics. It integrates naturally with Zipline Reloaded.

pyfolio-reloaded at a glance

Category
Portfolio optimization & analytics
Language
Python
License
Apache-2.0
Does
Performance analytics
Markets
Stocks, ETFs
Best for
Detailed tear sheets for equity strategies, especially from Zipline.
In AlgoGP
Use the exported strategy object from your own code

Pick it if

Detailed tear sheets for equity strategies, especially from Zipline.

Watch out for

Notebook-oriented plotting.

pyfolio-reloaded strengths and limitations

Strengths

  • Positions and transaction analysis, not only returns.
  • Familiar Quantopian format.

Limitations

  • Notebook-oriented plotting.
  • Overlaps with QuantStats for returns-only use.

pyfolio-reloaded example

pip install pyfolio-reloaded
Install
import pyfolio as pf
pf.create_returns_tear_sheet(returns, benchmark_rets=benchmark)
Returns tear sheet.

Use pyfolio-reloaded with AlgoGP

AlgoGP does not add pyfolio-reloaded to projects automatically yet, but nothing stops you using them together. Every AlgoGP project exports plain Python with a framework-neutral strategy object, so you can call it from pyfolio-reloaded yourself.

  1. 1

    Design and backtest in AlgoGP

    Describe the idea to the copilot and backtest it on AlgoGP’s normalized history.

  2. 2

    Add any bridge to get the adapter core

    Adding a bridged framework (for example Backtrader) writes frameworks/algogp_bridge.py, whose StrategyBridge.on_bar() returns the orders the strategy wants.

  3. 3

    Call it from pyfolio-reloaded

    Feed pyfolio-reloaded’s bars to StrategyBridge, place the returned orders with pyfolio-reloaded, and report fills back with sync().

pyfolio-reloaded: frequently asked questions

pyfolio or QuantStats?

QuantStats for quick HTML reports; pyfolio for position and transaction-level analysis.

pyfolio-reloaded alternatives

Independent guide. AlgoGP is not affiliated with pyfolio-reloaded. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.

Build a strategy