Backtesting your algorithm
Backtesting is the process of testing your trading algorithm on bits of historical data in order to simulate its performance. While it's no guarantee that the algorithm will perform well in the wild, it gives us a good idea of how it will perform.
In Python, we can backtest our algorithms using a library called Zipline. Zipline was created by the online trading algorithms platform Quantopian as their backtesting platform, and it's been open sourced to the public on GitHub. It provides ten years of historical stock data and a realistic trading environment in which you can test algorithms, including transaction costs, order delays, and slippage. Slippage is the price difference that can occur between the expected ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access