A fast, extensible, transparent python library for backtesting quantitative strategies.
|PyVersion| |Status| |License|
pyqstratpackage is designed for backtesting quantitative strategies. It was originally built for my own use as a quant trader / researcher, after I could not find a python based framework that was fast, extensible and transparent enough for use in my work.
This framework is designed for capable programmers who are comfortable with numpy and reasonably advanced Python techniques.
The goals are:
Using this framework, you can:
** NOTE: This is beta software and the API will change **
I would strongly recommend installing anaconda and creating an anaconda environment. See installation instructions at https://docs.anaconda.com/anaconda/install/
pyqstrat relies on numpy, scipy, matplotlib and pandas which in turn use Fortran and C code that needs to be compiled. It uses boost C++ libaries. It uses HDF5 data format as its market data file format.
conda install --channel conda-forge boost-cpp hdf5 libzip
pip install pyqstrat
The best way to get started is to go through this Jupyter notebook:
pyqstrat user group_ is the group used for pyqstrat discussions.
Before building this, I looked at the following. Although I ended up not using them, they are definitely worth looking at.
R quantstrat library_
Python backtrader project_
Some of the ideas I use in this framework come from the following books
Trading Systems: A New Approach to System Development and Portfolio Optimisation - Tomasini, Emilio and Jaekle, Urban_
Machine Trading - Chan, Ernie_
Algorithmic Trading: Winning Strategies and Their Rationale - Chan, Ernie_
The software is provided on the conditions of the simplified BSD license.
.. _Python: http://www.python.org
.. |PyVersion| image:: https://img.shields.io/badge/python-3.7+-blue.svg :alt:
.. |Status| image:: https://img.shields.io/badge/status-beta-green.svg :alt:
.. |License| image:: https://img.shields.io/badge/license-BSD-blue.svg :alt: