Skip to main content

PyPI Tests conda PyPI Coverage Status GitHub issues Discourse users Twitter Follow

pyfolio is a Python library for performance and risk analysis of financial portfolios that works well with the Zipline open source backtesting library.

Trading Strategy Analysis with pyfolio

At the core of pyfolio are various tear sheets that combine various individual plots and summary statistics to provide a comprehensive view of the performance of a trading algorithm.

Here's an example of a simple tear sheet analyzing a strategy executed with the Zipline backtesting engine:

Performance Metrics

The tear sheet presents performance and risk metrics for the strategy separately during the backtest and out-of-sample periods:

Performance Plots

In addition, it visualizes how several risk and return metrics behave over time:

Installation

To install pyfolio, run:

pip install pyfolio-reloaded

or

conda install -c ml4t pyfolio-reloaded

Development

For development, you may want to use a virtual environment to avoid dependency conflicts between pyfolio and other Python projects you have.

To get set up with a virtual env, run:

mkvirtualenv pyfolio

Next, clone this git repository and run python -m pip install .[all] and edit the library files directly.

Usage

A good way to get started is to run the pyfolio examples in a Jupyter notebook. To do this, you first want to start a Jupyter notebook server:

jupyter notebook

From the notebook list page, navigate to the pyfolio examples directory and open a notebook. Execute the code in a notebook cell by clicking on it and hitting Shift+Enter.

Questions?

If you find a bug, feel free to open an issue in this repository.

You can also join our community.

Support

Please open an issue for support.

Contributing

If you'd like to contribute, a great place to look is the issues marked with help-wanted.

For a list of core developers and outside collaborators, see the GitHub contributors list.

Release files for pyfolio-reloaded 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyfolio-reloaded 0.9.9
File Size Uploaded
pyfolio_reloaded-0.9.9.tar.gz 7.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyfolio-reloaded 0.9.9
File Interpreter ABI Platform
pyfolio_reloaded-0.9.9-py3-none-any.whl Python 3 none any Details

Total release size: 13.3 MB

Release files / pyfolio_reloaded-0.9.9.tar.gz

Download URL pyfolio_reloaded-0.9.9.tar.gz
Size 7.1 MB
Tags Source
SHA-256 checksum
How to use checksums
4dcd0bc6e07249458685e6591a105daafaa87c6b79a0680f71ba8e58435b5c0c
BLAKE2b-256 checksum
How to use checksums
efb3b37201fe90e8ce7e375fd451f7e7c1f70c79e9dba0fd43362b08609a6d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / pyfolio_reloaded-0.9.9-py3-none-any.whl

Download URL pyfolio_reloaded-0.9.9-py3-none-any.whl
Size 6.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
aa0e136b379bc6c7a48a74746c784c263de986575af5377348330eb1aed8791c
BLAKE2b-256 checksum
How to use checksums
650f66a8f8daec52c242d3cfda7886d72103c5ac0c6793fd185082309985f2a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.9.9 This release

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page