Skip to main content

Performance and risk analysis of financial portfolios with Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfolio_reloaded-0.9.7.tar.gz (7.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfolio_reloaded-0.9.7-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file pyfolio_reloaded-0.9.7.tar.gz.

File metadata

  • Download URL: pyfolio_reloaded-0.9.7.tar.gz
  • Upload date:
  • Size: 7.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pyfolio_reloaded-0.9.7.tar.gz
Algorithm Hash digest
SHA256 2b522ff514579b2760ad9a95d02cadd02078621c5da8c34a091a44de554a71d5
MD5 4919a91c1433700365fb3211035cacbc
BLAKE2b-256 2b78654f6cb4c6169329f9231876a2b4c70237df08f542f155bc771673718b97

See more details on using hashes here.

File details

Details for the file pyfolio_reloaded-0.9.7-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfolio_reloaded-0.9.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3d5c94105abd56d41b23841bb1c0d861d0a80ff747d5854d1b2ce192b774c330
MD5 db8665a8d4a6ad3958b8a0aa0d0acbc6
BLAKE2b-256 db73d8fa2f38c4f1f515e98668f08e285d723cfdb677f95ba66255eaa691415e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page