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.

Research-001111 min

Zipline in Python - Part 1: Quant Stack and Pipeline

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.