QuantRocket logo

Disclaimer

Data Collection - Indexes

Though most of our features will come from the Sharadar price and fundamental data, we also wish to add some additional features that reflect the broad market. Specifically, we will include features relating to the S&P 500, the VIX, and the NYSE TRIN (aka Arms Index, a breadth measure).

This data will come from Interactive Brokers.

First, start IB Gateway:

Collect listings

Next we collect the listings from IBKR. (For the S&P 500, we collect the SPY ETF because IBKR provides deeper history for SPY@ARCA than SPX@CBOE.)

Monitor flightlog for the completion messages:

quantrocket.master: INFO Collecting ARCA ETF listings from IBKR website (SPY only)
quantrocket.master: INFO Requesting details for 1 ARCA listings found on IBKR website
quantrocket.master: INFO Saved 1 ARCA listings to securities master database
quantrocket.master: INFO Collecting CBOE IND listings from IBKR website (VIX only)
quantrocket.master: INFO Requesting details for 1 CBOE listings found on IBKR website
quantrocket.master: INFO Saved 1 CBOE listings to securities master database
quantrocket.master: INFO Collecting NYSE IND listings from IBKR website (TRIN-NYSE only)
quantrocket.master: INFO Requesting details for 1 NYSE listings found on IBKR website
quantrocket.master: INFO Saved 1 NYSE listings to securities master database

Lookup Sids

Look up the Sids for the various instruments:

Collect historical data

Next, we create a database for collecting 1-day bars for the indexes:

Then collect the data:

Monitor flightlog for completion:

quantrocket.history: INFO [market-1d] Collecting history from IBKR for 3 securities in market-1d
quantrocket.history: INFO [market-1d] Saved 13302 total records for 3 total securities to quantrocket.v2.history.market-1d.sqlite

Next Up

Part 3: Moonshot Strategy Code