From signals to trades – Zipline for backtests
The open source library Zipline is an event-driven backtesting system. It generates market events to simulate the reactions of an algorithmic trading strategy and tracks its performance. A particularly important feature is that it provides the algorithm with historical point-in-time data that avoids look-ahead bias.
The library has been popularized by the crowd-sourced quantitative investment fund Quantopian, which uses it in production to facilitate algorithm development and live-trading.
In this section, we'll provide a brief demonstration of its basic functionality. Chapter 8, The ML4T Workflow – From Model to Strategy Backtesting, contains a more detailed introduction to prepare us for more complex use cases.
How to backtest a single-factor strategy
You can use Zipline offline in conjunction with data bundles to research and evaluate alpha factors. When using it on the Quantopian platform, you will...