Collect 1-minute US Stock Data

In Zipline terminology, databases are referred to as "bundles." To collect 1-minute sample data for US stocks, create a bundle and specify free=True. We will name the bundle "usstock-free-1min":

In [1]:
from quantrocket.zipline import create_usstock_bundle
create_usstock_bundle("usstock-free-1min", free=True)
Out[1]:
{'status': 'success', 'msg': 'successfully created usstock-free-1min bundle'}

This creates an empty bundle. Next, we need to fill up the bundle with data. This is called "ingestion" in Zipline terminology. Ingestion runs asynchronously (that is, in the background), so it's a good idea to open a terminal for flightlog if you haven't already done so in order to monitor the progress. In the terminal, fire up flightlog:

quantrocket flightlog stream

Then ingest the data:

In [2]:
from quantrocket.zipline import ingest_bundle
ingest_bundle("usstock-free-1min")
Out[2]:
{'status': 'the data will be ingested asynchronously'}

Use flightlog to monitor the progress:

quantrocket.zipline: INFO [usstock-free-1min] Ingesting minute bars for 8 securities in usstock-free-1min bundle
quantrocket.zipline: INFO [usstock-free-1min] Ingesting daily bars for usstock-free-1min bundle
quantrocket.zipline: INFO [usstock-free-1min] Ingesting adjustments for usstock-free-1min bundle
quantrocket.zipline: INFO [usstock-free-1min] Ingesting assets for usstock-free-1min bundle
quantrocket.zipline: INFO [usstock-free-1min] Completed ingesting data for 8 securities in usstock-free-1min bundle