Running Zipline backtesting from the command line
For large backtesting jobs, it's preferred to run backtesting from the command line.
The following command runs the backtesting strategy defined in the job.py
Python script and saves the resulting DataFrame in the job_results.pickle
pickle file:
zipline run -f job.py --start 2016-1-1 --end 2021-1-1 -o job_results.pickle --no-benchmark
For example, you can set up a batch consisting of tens of Zipline command-line jobs to run overnight, with each storing the results in a pickle file for later analysis.
It's a good practice to keep a journal and library of past backtesting pickle files for easy reference.