Importing market data into a Zipline/PyFolio backtesting system
Backtesting depends on us having an extensive market data database.
Zipline introduces two market data-specific terms – bundle and ingest:
- A bundle is an interface for incrementally importing market data into Zipline's proprietary database from a custom source.
- An ingest is the actual process of incrementally importing the custom source market data into Zipline's proprietary database; the data ingest is not automatically updated. Each time you need fresh data, you must re-ingest the bundle.
By default, Zipline supports these bundles:
- Historical Quandl bundle (complimentary daily data for US equities up to 2018)
.csv
files bundle
We will now learn how to import these two bundles in more detail.
Importing data from the historical Quandl bundle
First, in the activated zipline_env
environment, set the QUANDL_API_KEY
environment variable to your free (or paid)...