Giter Club home page Giter Club logo

pyfolio's Introduction

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.

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 tear sheet analyzing returns, which comes from the Zipline algorithm sample notebook:

example tear 0 example tear 1

See also slides of a talk about pyfolio.

Installation

(Optional) Virtual Environment

For development on pyfolio itself, you might 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

before running the install commands below.

To install pyfolio via pip issue the following command:

pip install pyfolio

For development, clone the git repo and run python setup.py develop and edit the library files directly. Make sure to reload or restart the IPython kernel when you make changes.

pyfolio has the following dependencies:

  • numpy
  • scipy
  • pandas
  • matplotlib
  • seaborn
  • pymc3 (optional)
  • zipline (optional; requires master, not 0.7.0)

Some of Pyfolio's functionality, such as the Bayesian tearsheet, requires PyMC3 and Theano. To get set up, you can run:

pip install theano
pip install git+https://github.com/pymc-devs/pymc3

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 examples in a Jupyter notebook.

To get set up with an example, you can:

Run a Jupyter notebook server via:

jupyter notebook

From the notebook list page(usually found at http://localhost:8888/), navigate over to the examples directory, and open any file with a .ipynb extension.

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 on our github tracker.

You can also join our mailing list.

Contribute

If you want to contribute, a great place to start would be the help-wanted issues.

Credits

For a full list of contributors, see https://github.com/quantopian/pyfolio/graphs/contributors.

pyfolio's People

Contributors

twiecki avatar gusgordon avatar a-campbell avatar analicia avatar abhijeetkalyan avatar richafrank avatar ssanderson avatar sbussmann avatar justinlent avatar adzuci avatar tswright8281 avatar dat-boris avatar jlopezpena avatar devinstevenson avatar gitter-badger avatar mriduls avatar jkrauss82 avatar llllllllll avatar jimgoo avatar jonathanng avatar bingyao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.