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-tej-2.0.2.tar.gz (88.2 kB view details)

Uploaded Source

Built Distribution

pyfolio_tej-2.0.2-py3-none-any.whl (74.3 kB view details)

Uploaded Python 3

File details

Details for the file pyfolio-tej-2.0.2.tar.gz.

File metadata

  • Download URL: pyfolio-tej-2.0.2.tar.gz
  • Upload date:
  • Size: 88.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyfolio-tej-2.0.2.tar.gz
Algorithm Hash digest
SHA256 5d9c38dbb5c7faead6d91134f1b51d78ea778959decbd5fde865d41ce1721378
MD5 5235ddb33c36b8f06a16126f2ac8469e
BLAKE2b-256 8aa06e1050f57a4b48e16b6afa44ee02ed83c49108828ecb9d471e212c367667

See more details on using hashes here.

File details

Details for the file pyfolio_tej-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyfolio_tej-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 74.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pyfolio_tej-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8470c4610af1b125e60e9253f0ed06f89867f8a3ee4a6d3df48f58d6be6fd22
MD5 630469eba8f0a1fa550f1fc54bb4235d
BLAKE2b-256 cbf42b6a315d2b66a60e12c402b504d5759b6c60d579ae6dbc8457f0b3535dd2

See more details on using hashes here.

Supported by

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