TickData

US Cash Indices

Introduction

The US Cash Indices dataset by TickData covers 3 US Indices: SPX, VIX, and NDX. The data starts on various dates from Janunary 1998 and is delivered on any frequency from tick to daily. This dataset is created by TickData negotiating directly with exchanges for their official archive and by partnering with real-time data providers who have direct exchange connections and multiple redundant ticker plants.

For more information about the US Cash Indices dataset, including CLI commands and pricing, see the dataset listing.

About the Provider

TickData was founded by a futures broker and a programmer in 1984 as the first company in the world to offer historical tick-by-tick prices on the futures and index markets. TickData provides access to comprehensive and detailed market data and analytics products in the financial industry covering Equities, Futures, Options, cash FOREX, and Cash Indices.

Getting Started

The following snippet demonstrates how to request data from the US Cash Indices dataset:

self.symbol = self.AddIndex("VIX", Resolution.Daily).Symbol
_symbol = AddIndex("VIX", Resolution.Daily).Symbol;

Data Summary

The following table describes the dataset properties:

PropertyValue
Start DateJanuary 1998*
Coverage3 US Indices
Data DensityDense
ResolutionTick, Second, Minute, Hour, & Daily
TimezoneNew York

Supported Indices

The following table shows the available indices:

TickerIndexExpiryStart Date
VIXS&P50030 DaysJul 2003
SPXS&P500-Jan 1998
NDXNASDAQ-100-Jan 1998

VIX - CBOE Volatility Index

The Cboe Volatility Index (VIX) is a real-time index that represents the market's expectations for the relative strength of near-term price changes of the S&P 500 index (SPX). Because it's derived from the prices of SPX index Options with near-term expiration dates, it generates a 30-day forward projection of volatility. Volatility, or how fast prices change, is often seen as a way to gauge market sentiment, and in particular, the degree of fear among market participants.

SPX - S&P 500 Index

The S&P 500 Index, or the Standard & Poor's 500 Index, is a market-capitalization-weighted index of the 500 largest publicly-traded companies in the U.S. It is not an exact list of the top 500 U.S. companies by market capitalization because there are other criteria included in the index. The index is widely regarded as the best gauge of large-cap U.S. Equities.

NDX - Nasdaq 100 Index

The Nasdaq 100 Index is a basket of the 100 largest, most actively traded U.S companies listed on the Nasdaq stock exchange. The index includes companies from various industries except for the financial industry, like commercial and investment banks. These non-financial sectors include retail, biotechnology, industrial, technology, health care, and others.

Data Point Attributes

The US Cash Indices dataset provides TradeBar and Tick objects.

TradeBar Attributes

TradeBar objects have the following attributes:

Tick Attributes

Tick objects have the following attributes:

Requesting Data

To add US Cash Indices data to your algorithm, call the AddIndex method. Save a reference to the Index Symbol so you can access the data later in your algorithm.

class USCashIndexAlgorithm(QCAlgorithm):

    def Initialize(self) -> None:
        self.SetStartDate(2020, 6, 1)
        self.SetEndDate(2021, 6, 1)
        self.SetCash(100000)

        self.symbol = self.AddIndex("VIX").Symbol
namespace QuantConnect
{
    public class USCashIndexAlgorithm : QCAlgorithm
    {
        private Symbol _symbol;
        
        public override void Initialize()
        {
            SetStartDate(2020, 6, 1);
            SetEndDate(2021, 6, 1);
            SetCash(100000);
            
            _symbol = AddIndex("VIX").Symbol;
        }
    }
}

For more information about creating Index subscriptions, see Requesting Data.

Accessing Data

To get the current US Cash Indices data, index the Bars or Ticks properties of the current Slice with the Index Symbol. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your security at every time step. To avoid issues, check if the Slice contains the data you want before you index it.

def OnData(self, slice: Slice) -> None:
    if self.symbol in slice.Bars:
        trade_bar = slice.Bars[self.symbol]
        self.Log(f"{self.symbol} close at {slice.Time}: {trade_bar.Close}")

    if self.symbol in slice.Ticks:
        ticks = slice.Ticks[self.symbol]
        for tick in ticks:
            self.Log(f"{self.symbol} price at {slice.Time}: {tick.Price}")
public override void OnData(Slice slice)
{
    if (slice.Bars.ContainsKey(_symbol))
    {
        var tradeBar = slice.Bars[_symbol];
        Log($"{_symbol} price at {slice.Time}: {tradeBar.Close}");
    }

    if (slice.Ticks.ContainsKey(_symbol))
    {
        var ticks = slice.Ticks[_symbol];
        foreach (var tick in ticks)
        {
            Log($"{_symbol} price at {slice.Time}: {tick.Price}");
        }
    }
}

You can also iterate through all of the data objects in the current Slice.

def OnData(self, slice: Slice) -> None:
    for symbol, trade_bar in slice.Bars.items():
        self.Log(f"{symbol} close at {slice.Time}: {trade_bar.Close}")

    for symbol, ticks in slice.Ticks.items():
        for tick in ticks:
            self.Log(f"{symbol} price at {slice.Time}: {tick.Price}")
public override void OnData(Slice slice)
{
    foreach (var kvp in slice.Bars)
    {
        var symbol = kvp.Key;
        var tradeBar = kvp.Value;
        Log($"{symbol} price at {slice.Time}: {tradeBar.Close}");
    }

    foreach (var kvp in slice.Ticks)
    {
        var symbol = kvp.Key;
        var ticks = kvp.Value;
        foreach (var tick in ticks)
        {
            Log($"{symbol} price at {slice.Time}: {tick.Price}");
        }
    }
}

For more information about accessing US Index data, see Handling Data.

Historical Data

To get historical US Cash Indices data, call the History method with the Index Symbol. If there is no data in the period you request, the history result is empty.

# DataFrame
history_df = self.History(self.symbol, 100, Resolution.Daily)

# TradeBar objects
history_bars = self.History[TradeBar](self.symbol, 100, Resolution.Daily)

# Tick objects
history_ticks = self.History[Tick](self.symbol, timedelta(seconds=10), Resolution.Tick)
// TradeBar objects
var historyBars = History(_symbol, 100, Resolution.Daily);

// Tick objects 
var historyTicks = History<Tick>(_symbol, TimeSpan.FromSeconds(10), Resolution.Tick);

For more information about historical data, see History Requests.

Remove Subscriptions

To remove a US Index subscription, call the RemoveSecurity method.

self.RemoveSecurity(self.symbol)
RemoveSecurity(_symbol);

Example Applications

The US Cash Indices enables you to incorporate popular US indicies into your trading algorithms. Examples include the following use cases:

  • Exploring the difference between the Index and the ETF that tracks it
  • Using these indicies as the underlying asset for US Index Options strategies
  • Understanding the stock market's level of expected forward-looking volatility, also known as the "fear index". When the VIX starts moving higher, it is telling you that traders are getting nervous. When the VIX starts moving lower, it is telling you that traders are gaining confidence.

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: