Series · Active
Zipline in Python
Backtesting in Python with zipline-reloaded: quant stack, pipeline and a first backtest; data bundles, analysis with pandas and a Backtrader comparison.
02/02 parts
- Part 1: Zipline in Python - Part 1: Quant Stack and PipelinePublished
- Part 2: Zipline, Backtesting in Python 2: My First Data AnalysisPublished
A hands-on series on backtesting with zipline-reloaded, the maintained branch of Zipline, the engine that came from Quantopian. It is written for readers who know Python and pandas and want a research and backtesting setup in Python.
Part 1 starts with a five-minute smoke test: install zipline-reloaded and call run_algorithm on a bundle. It then covers what Quantopian was and the quant stack: ArcticDB for data, zipline-reloaded for backtests, alphalens for factor analysis, and pyfolio and empyrical for reports and ratios. It ends with a pytest test that checks a strategy runs end to end on a known bundle. Part 2 explains what a data bundle contains, loads one, lists its assets, queries prices into pandas, runs a basic strategy with run_algorithm and gives a rule for choosing between Zipline and Backtrader.
The series is still open; two parts are published so far. Together they give a working install, a first backtest and a test that guards it.