Collect US Stock Sample Data

This tutorial outlines how to collect sample data for US stocks. This dataset contains minute data, but also supports querying of daily data. The dataset is synced from QuantRocket's cloud and stored in a Zipline bundle, a type of local database. See the usage guide for more information.

Start by creating an empty bundle called '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'}

Then collect the data, which in Zipline bundle terminology is referred to as ingestion:

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 9 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 9 securities in usstock-free-1min bundle