QuantRocket logo

Disclaimer

Zipline Backtest

We're ready to run a backtest. Zipline strategies are referenced by the filename without extension; thus, to run the strategy in our winners.py file, we use the code "winners".

Some Zipline backtests can be long-running. You can use the progress parameter to tell Zipline to log progress and performance statistics to flightlog periodically during the backtest. In this example, we log progress for each month of the simulation (progress="M"). Make sure flightlog is running in a terminal so you can see the progress output, then run the backtest:

Zipline returns the backtest results as a CSV. You can use pyfolio, a companion library to Zipline, to look at a tear sheet of performance results:


Back to Introduction