Now we are ready to run a backtest. Open a flightlog terminal to monitor the progress and performance statistics while the backtest runs:
from quantrocket.zipline import backtest
backtest(
"sell-gap",
start_date="2014-01-03",
end_date="2020-04-30",
capital_base=2e5,
filepath_or_buffer="sell_gap_backtest_results.csv",
progress="M")
Then view the pyfolio tear sheet:
import pyfolio
pyfolio.from_zipline_csv("sell_gap_backtest_results.csv")