• Stars
    star
    5,596
  • Rank 7,305 (Top 0.2 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Portfolio and risk analytics in Python

pyfolio

pyfolio

Join the chat at https://gitter.im/quantopian/pyfolio build status

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. Quantopian also offers a fully managed service for professionals that includes Zipline, Alphalens, Pyfolio, FactSet data, and more.

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. Here's an example of a simple tear sheet analyzing a strategy:

simple tear 0 simple tear 1

Also see slides of a talk about pyfolio.

Installation

To install pyfolio, run:

pip install pyfolio

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 setup.py develop and edit the library files directly.

Matplotlib on OSX

If you are on OSX and using a non-framework build of Python, you may need to set your backend:

echo "backend: TkAgg" > ~/.matplotlib/matplotlibrc

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 mailing list or our Gitter channel.

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.

More Repositories

1

zipline

Zipline, a Pythonic Algorithmic Trading Library
Python
17,443
star
2

alphalens

Performance analysis of predictive (alpha) stock factors
Jupyter Notebook
3,330
star
3

qgrid

An interactive grid for sorting, filtering, and editing DataFrames in Jupyter notebooks
Python
3,034
star
4

research_public

Quantitative research and educational materials
Jupyter Notebook
2,400
star
5

empyrical

Common financial risk and performance metrics. Used by zipline and pyfolio.
Python
1,268
star
6

trading_calendars

Calendars for various securities exchanges.
Python
608
star
7

qdb

Quantopian Remote Debugger for Python
Python
315
star
8

quantopian-algos

Library of algorithm scripts for Quantopian
Python
174
star
9

pgcontents

A Postgres-backed ContentsManager implementation for Jupyter
Python
150
star
10

coal-mine

Coal Mine - Periodic task execution monitor
Python
114
star
11

bayesalpha

Bayesian models to compute performance and uncertainty of returns and alpha.
Python
105
star
12

algorithm-component-library

A collection of code snippets that can be constructed into larger trading algorithms.
Python
103
star
13

PenguinDome

Simple Linux Mobile Device Management
Python
90
star
14

libpy

Utilities for writing C++ extension modules.
C++
82
star
15

warp_prism

Quickly move data from postgres to numpy or pandas.
C
64
star
16

qgrid-notebooks

Notebooks which will provide a demo of Qgrid functionality
Jupyter Notebook
20
star
17

serializable-traitlets

JSON-Serializable IPython Traitlets
Python
13
star
18

metautils

Utilities for writing metaclasses.
Python
8
star
19

DockORM

An object-relational mapper for docker containers.
Python
8
star
20

quantopian-drafts

Drafts for new Quantopian features.
6
star
21

aqueduct-client

Python wrapper for Quantopian's Aqueduct API
Python
2
star
22

nose_xunit_gevent

Xunit for the nose_gevented_multiprocess plugin
Python
2
star
23

quantopian.github.io

CSS
1
star