from quantrocket.zipline import create_usstock_bundle
create_usstock_bundle("usstock-1d-bundle", data_frequency="daily")
{'status': 'success', 'msg': 'successfully created usstock-1d-bundle bundle'}
Then ingest the data:
from quantrocket.zipline import ingest_bundle
ingest_bundle("usstock-1d-bundle")
{'status': 'the data will be ingested asynchronously'}
Use flightlog to monitor the progress:
quantrocket.zipline: INFO [usstock-1d-bundle] Ingesting daily bars for usstock-1d-bundle bundle
quantrocket.zipline: INFO [usstock-1d-bundle] Ingesting adjustments for usstock-1d-bundle bundle
quantrocket.zipline: INFO [usstock-1d-bundle] Ingesting assets for usstock-1d-bundle bundle
quantrocket.zipline: INFO [usstock-1d-bundle] Completed ingesting data for 24749 securities in usstock-1d-bundle bundle
Next, collect borrow fees, which are organized by country:
from quantrocket.fundamental import collect_ibkr_borrow_fees
collect_ibkr_borrow_fees(countries="usa")
{'status': 'the borrow fees data will be collected asynchronously'}
Use flightlog to monitor for completion:
quantrocket.fundamental: INFO Collecting ibkr usa borrow fees data from 2024-05-01 to present
quantrocket.fundamental: INFO Saved 2104318 total ibkr borrow fees records to quantrocket.v2.fundamental.ibkr.stockloan.fees.sqlite