QuantConnect

US Index Option Universe

Introduction

The US Index Option Universe dataset by QuantConnect lists the available US Index Options contracts and the current Implied Volatility and Greeks. The data covers European Option contracts for 3 US Indices: SPX, VIX, and NDX. It starts in January 2012 and is delivered on a daily update frequency. To create this dataset, we use our implementation of the forward tree pricing model, which accounts for the interest rate, dividend payments, and daily closing prices. The values in this dataset are the same values you can get from daily indicators with mirror Options.

This dataset does not contain market data. For market data, see US Index Options by AlgoSeek.

For more information about the US Index Option Universe dataset, including CLI commands and pricing, see the dataset listing.

About the Provider

QuantConnect was founded in 2012 to serve quants everywhere with the best possible algorithmic trading technology. Seeking to disrupt a notoriously closed-source industry, QuantConnect takes a radically open-source approach to algorithmic trading. Through the QuantConnect web platform, more than 50,000 quants are served every month.

Getting Started

The following snippet demonstrates how to request data from the US Index Options Universe dataset:

option = self.add_index_option('VIX')
option.set_filter(lambda universe: universe.delta(0.4, 0.6))
self.option_symbol = option.symbol
var option = AddIndexOption("VIX");
option.SetFilter(universe => universe.delta(0.4m, 0.6m));
_optionSymbol = option.Symbol;

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateJanuary 2012
Asset Coverage7 Index Options
Data DensityDense
ResolutionDaily
TimezoneNew York

Specification Over Time

According to the SPX Options contract specification, some SPX contracts expire every month and SPXW contracts expires every day. Before 2021, you could only trade SPX contracts with the following expiration dates:

  • Expires within the next 4 months
  • Expires in September within the next 14 months
  • Expires in January, March, or June within the next 2 years
  • Expires in December within the next 3 years

During this time, SPXW didn't have 0DTE every day.

Sources:
- Cboe Options Exchange to List Three Long-Dated SPX Options Expirations, Beginning November 1, 2021
- S&P 500 Weekly Options Now Expire Five Days a Week

Example Applications

The US Index Options Universe dataset enables you to accurately design strategies for Index Options. Examples include the following strategies:

  • Buying VIX call Options to hedge against upcoming volatility
  • Buying VIX put Options to capture the natural downward price movement in the VIX index
  • Buying SPX put Options to protect against downward price movement in the S&P 500

For more example algorithms, see Examples.

Data Point Attributes

The US Index Options Universe dataset provides OptionUniverse object, which have the following attributes:

Supported Assets

The following table shows the available Index Options:

Underlying IndexUnderlying TickerTarget TickerStandard ContractsWeekly ContractsTradable on Expiry Day
S&P500VIXgreen check
S&P500VIXVIXWgreen check
S&P500SPXgreen check
S&P500SPXSPXWgreen checkgreen check
NASDAQ-100NDXgreen check
NASDAQ-100NDXNDXPgreen checkgreen check
NASDAQ-100NDXNQXgreen checkgreen checkgreen check

For more information about each underlying Index, see Supported Indices.

Requesting Data

To add US Index Options Universe data to your algorithm, call the AddIndexOptionadd_index_option method. Save a reference to the Index Option Symbol so you can access the data later in your algorithm. To define which contracts should be in your universe, call the SetFilterset_filter method of the IndexOption object.

The AddIndexOptionadd_index_option method provides a daily stream of Option chain data. To get the most recent daily chain, call the OptionChainoption_chain method with the canonical Index Option Symbol. The OptionChainoption_chain method returns data on all the tradable contracts, not just the contracts that pass your universe filter.

class IndexOptionsDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2021, 1, 1)
        self.set_end_date(2021, 6, 1)
        self.set_cash(1_000_000)
        self.universe_settings.asynchronous = True
        self.index_symbol = self.add_index('VIX').symbol
        
        standard_option = self.add_index_option(self.index_symbol)
        standard_option.set_filter(self._option_filter)
        self.standard_option_symbol = standard_option.symbol
        standard_chain = self.option_chain(standard_option.symbol, flatten=True).data_frame

        weekly_option = self.add_index_option(self.index_symbol, "VIXW")
        weekly_option.set_filter(self._option_filter)
        self.weekly_option_symbol = weekly_option.symbol
        weekly_chain = self.option_chain(weekly_option.symbol, flatten=True).data_frame
        weekly_chain = weekly_chain[
            weekly_chain.index.map(lambda symbol: not IndexOptionSymbol.is_standard(symbol))
        ]
        

    def _option_filter(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:
        # Contracts can be filtered by greeks, implied volatility, open interest:
        return universe \
            .delta(0.5, 1.5) \
            .gamma(0.0001, 0.0006) \
            .vega(0.01, 1.5) \
            .theta(-2.0, -0.5) \
            .rho(0.5, 3.0) \
            .implied_volatility(1, 3) \
            .open_interest(100,500)
namespace QuantConnect
{
    public class IndexOptionsDataAlgorithm : QCAlgorithm
    {
    	private Symbol _indexSymbol, _standardOptionSymbol, _weeklyOptionSymbol;

        public override void Initialize()
        {
            SetStartDate(2021, 1, 1);
            SetEndDate(2021, 6, 1);
            SetCash(100000);
            UniverseSettings.Asynchronous = True;
            _indexSymbol = AddIndex("VIX").Symbol;

            var standardOption = AddIndexOption(_indexSymbol);
            standardOption.SetFilter(OptionFilter);
            _standardOptionSymbol = standardOption.Symbol;
            var standardChain = OptionChain(_standardOptionSymbol);

            var weeklyOption = AddIndexOption(_indexSymbol, "VIXW");
            weeklyOption.SetFilter(OptionFilter);
            _weeklyOptionSymbol = weeklyOption.Symbol;
            var weeklyChain = OptionChain(_weeklyOptionSymbol)
                .Where(contract => !IndexOptionSymbol.IsStandard(contract.Symbol));
        }

        private virtual OptionFilterUniverse OptionFilter(OptionFilterUniverse universe)
        {
            // Contracts can be filtered by greeks, implied volatility, open interest:
            return universe
                .Delta(0.5m, 1.5m)
                .Gamma(0.0001m, 0.0006m)
                .Vega(0.01m, 1.5m)
                .Theta(-2.0m, -0.5m)
                .Rho(0.5m, 3.0m)
                .ImpliedVolatility(1.0m, 3.0m)
                .OpenInterest(100, 500);
        }
    }
}

The Index resolution must be less than or equal to the Index Option resolution. For example, if you set the Index resolution to minute, then you must set the Index Option resolution to minute, hour, or daily.

For more information about creating US Index Option subscriptions, see Index Options.

Accessing Data

For information about accessing US Equity Options data, see Handling Data.

Historical Data

You can get historical US Index Options data in an algorithm and the Research Environment.

Historical Data In Algorithms

To get historical US Index Options Universe data in an algorithm, call the History<OptionUniverse>history method with the canonical Index Option Symbol. This method returns data on all of the tradable contracts, not just the contracts that pass your universe filter. If there is no data in the period you request, the history result is empty.

# DataFrame
history_df = self.history(self.standard_option_symbol, timedelta(3))

# OptionUniverse objects
history = self.history[OptionUniverse](self.standard_option_symbol, timedelta(3))
// OptionUniverse objects 
var history = History<OptionUniverse>(_standardOptionSymbol, TimeSpan.FromDays(3)).ToList();

For more information about Index Options Universe data in algorithms, see Historical Data.

Historical Data In Research

To get historical US Index Options Universe data in the Research Environment, call the History<OptionUniverse>history method with the canonical Option Symbol. This method returns data on all of the tradable contracts, not just the contracts that pass your universe filter.

qb = QuantBook()
index_symbol = qb.add_index('VIX').symbol
option = qb.add_index_option(index_symbol) # or qb.add_index_option(index_symbol, "VIXW")
history = qb.history(option.symbol, datetime(2020, 6, 1), datetime(2020, 6, 5))
var qb = new QuantBook();
var indexSymbol = qb.AddIndex("VIX").Symbol;
var option = qb.AddIndexOption(indexSymbol); // or qb.AddIndexOption(indexSymbol, "VIXW");
var history = qb.History<OptionUniverse>(option.Symbol, new DateTime(2020, 6, 1), new DateTime(2020, 6, 6));
foreach (var chain in history)
{
    var endTime = chain.EndTime;
    var filteredContracts = chain.Data
        .Select(contract => contract as OptionUniverse)
        .Where(contract => contract.Greeks.Delta > 0.3m);
    foreach (var contract in filteredContracts)
    {
        var price = contract.Price;
        var iv = contract.ImpliedVolatility;
    }
}

For more information about historical Index Options Universe data in the Research Environment, see Universes.

Example Applications

The US Index Options Universe dataset enables you to accurately design strategies for Index Options. Examples include the following strategies:

  • Buying VIX call Options to hedge against upcoming volatility
  • Buying VIX put Options to capture the natural downward price movement in the VIX index
  • Buying SPX put Options to protect against downward price movement in the S&P 500

For more example algorithms, see Examples.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: