The VMOT trend strategy hedges market risk by shorting the US market under certain conditions. We'll use SPY for this purpose, from the Sharadar ETF dataset.
First, create a database for Sharadar ETF prices:
from quantrocket.history import create_sharadar_db
create_sharadar_db("sharadar-us-etf-1d", sec_type="ETF", country="US")
{'status': 'successfully created quantrocket.v2.history.sharadar-us-etf-1d.sqlite'}
Then collect the data:
from quantrocket.history import collect_history
collect_history("sharadar-us-etf-1d")
{'status': 'the historical data will be collected asynchronously'}
This runs in the background, monitor flightlog for a completion message:
quantrocket.history: INFO [sharadar-us-etf-1d] Collecting Sharadar US ETF prices
quantrocket.history: INFO [sharadar-us-etf-1d] Collecting updated Sharadar US securities listings
quantrocket.history: INFO [sharadar-us-etf-1d] Finished collecting Sharadar US ETF prices
Next, look up the sid for SPY. This will be used in the trend strategy. Looking up the sid requires a bit less typing with the CLI:
!quantrocket master get -s SPY -t ETF --fields Sid Symbol Exchange | csvlook
| Sid | Symbol | Exchange | | -------------- | ------ | -------- | | FIBBG000BDTBL9 | SPY | ARCX |