Zipline, Backtesting in Python 2: My First Data Analysis
In this second part of the Zipline tutorial, we will perform our first data analysis using bundles and build a basic strategy.
Topic
Zipline for backtesting quantitative strategies in Python.
2 reports
Zipline is a Python library for event-driven backtesting, developed by Quantopian for research, backtesting and live trading. Since the platform closed, the community has maintained it as zipline-reloaded. It works with data bundles: prices are ingested once, with splits and dividends, and the strategy queries them during the simulation.
The research in this topic builds a quant stack around Zipline. The first tells what Quantopian was, explains the role of zipline-reloaded, alphalens, pyfolio, empyrical and ArcticDB, and runs a minimal backtest: a 60/40 SPY/IEF portfolio with monthly rebalancing. The second reads a data bundle outside the pipeline with DataPortal, analyzes the Kendall correlation and cumulative returns of sector ETFs in pandas and gives a criterion for choosing between Zipline and Backtrader.
In this second part of the Zipline tutorial, we will perform our first data analysis using bundles and build a basic strategy.
In algorithmic trading there are countless options for carrying out your analyses or backtests, but we are going to use the best quant stack to build a professional research and backtesting pipeline.