About Cash Indices

The Cash Indices dataset by QuantConnect covers 125 US Indices and 3 International indices. The data starts on various dates from January 1998 and is delivered on any frequency from minute to daily.


About QuantConnect

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.


About QuantConnect

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.


Algorithm Example

from AlgorithmImports import *
from QuantConnect.DataSource import *

class IndexDataAlgorithm(QCAlgorithm):

    def initialize(self) -> None:
        self.set_start_date(2020, 1, 1)
        self.set_end_date(2021, 7, 8)
        self.set_cash(100000)

        # Request SPY data as a trading vehicle for SPX
        self.spy = self.add_equity("SPY").symbol

        # Request SPX data for trade signal generation
        spx = self.add_index("SPX").symbol

        # Create short and long-term EMA indicators for trend estimation to trade
        self.ema_fast = self.EMA(spx, 80, Resolution.DAILY)
        self.ema_slow = self.EMA(spx, 200, Resolution.DAILY)
        self.set_warm_up(200, Resolution.DAILY)

        # Historical data
        history = self.history(spx, 60, Resolution.DAILY)
        self.debug(f'We got {len(history.index)} items from our history request')

    def on_data(self, slice: Slice) -> None:
        # Trade signals required indicators to be ready
        if self.is_warming_up or not self.ema_slow.is_ready:
            return

        # If short-term EMA is above long-term, it indicates an up trend, so we buy SPY
        if not self.portfolio.invested and self.ema_fast > self.ema_slow:
            self.set_holdings(self.spy, 1)
        # If it is the reverse, it indicates a downtrend, and we liquidate any position
        elif self.ema_fast < self.ema_slow:
            self.liquidate()

Example Applications

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