Our machine learning strategy will run on the universe of all US stocks.
Start by collecting US stock data from Sharadar. Fundamental and price data are collected separately but can be run simultaneously.
To collect the fundamentals:
from quantrocket.fundamental import collect_sharadar_fundamentals
collect_sharadar_fundamentals(country="US")
This runs in the background, monitor flightlog for a completion message:
quantrocket.fundamental: INFO Collecting Sharadar US fundamentals
quantrocket.fundamental: INFO Collecting updated Sharadar US securities listings
quantrocket.fundamental: INFO Finished collecting Sharadar US fundamentals
First, create a database for Sharadar stock prices:
from quantrocket.history import create_sharadar_db
create_sharadar_db("sharadar-us-stk-1d", sec_type="STK", country="US")
Then collect the data:
from quantrocket.history import collect_history
collect_history("sharadar-us-stk-1d")
This runs in the background, monitor flightlog for a completion message:
quantrocket.history: INFO [sharadar-us-stk-1d] Collecting Sharadar US STK prices
quantrocket.history: INFO [sharadar-us-stk-1d] Collecting updated Sharadar US securities listings
quantrocket.history: INFO [sharadar-us-stk-1d] Finished collecting Sharadar US STK prices