VIX Data Collection

The backtest revealed that this strategy was mainly profitable during the 2008 financial crisis and again in 2020 during the COVID-19 pandemic. In line with this observation, the authors of the source paper note that the predictive power of the first half hour is greater during periods of high volatility.

We will use intraday VIX data to investigate this observation further. This data comes from Interactive Brokers.

Collect CBOE index listings

First, start IB Gateway:

In [1]:
from quantrocket.ibg import start_gateways
start_gateways(wait=True)
Out[1]:
{'ibg1': {'status': 'running'}}

Then, collect all index listings from CBOE:

In [2]:
from quantrocket.master import collect_ibkr_listings
collect_ibkr_listings(exchanges="CBOE", sec_types="IND")
Out[2]:
{'status': 'the IBKR listing details will be collected asynchronously'}

Monitor flightlog for a completion message:

quantrocket.master: INFO Collecting CBOE IND listings from IBKR website
quantrocket.master: INFO Requesting details for 206 CBOE listings found on IBKR website
quantrocket.master: INFO Saved 206 CBOE listings to securities master database

Lookup VIX

Next, we look up the Sid for VIX.

In [3]:
!quantrocket master get --symbols 'VIX' --exchanges 'CBOE' --sec-types 'IND' --fields 'Sid' 'Symbol' --json | json2yaml
---
  - 
    Sid: "IB13455763"
    Symbol: "VIX"

Collect historical data

Next, we create a database for collecting 30-min bars for VIX:

In [4]:
from quantrocket.history import create_ibkr_db
create_ibkr_db("vix-30min", sids="IB13455763", bar_size="30 mins", shard="off")
Out[4]:
{'status': 'successfully created quantrocket.v2.history.vix-30min.sqlite'}

Then collect the data:

In [5]:
from quantrocket.history import collect_history
collect_history("vix-30min")
Out[5]:
{'status': 'the historical data will be collected asynchronously'}

Monitor flightlog for completion:

quantrocket.history: INFO [vix-30min] Collecting history from IBKR for 1 securities in vix-30min
quantrocket.history: INFO [vix-30min] Saved 53788 total records for 1 total securities to quantrocket.v2.history.vix-30min.sqlite

Next Up

Part 4: VIX Research