Skip to main content
Python function: getOHLCV()
SpecificationValue
Delivery Frequencycontinuous
Data Frequencydaily, intraday (min/hour)
Reporting LagReal-time during market hours
CoverageMajor U.S. indices (S&P 500, DJIA, NASDAQ, Russell, VIX, sector indices)
HistorySince 2003-01-02
AvailabilityFree

Product Overview

Overview

Index OHLCV provides standardized Open, High, Low, Close, and Volume bars for major market indices. Tickers use the I: prefix convention (e.g., I:SPX for the S&P 500, I:DJI for the Dow Jones Industrial Average). The legacy ^ prefix (e.g., ^SPX) is also accepted. Index values are computed from their constituent securities and disseminated by the index provider or exchange. Scalar Field aggregates tick-level index values into OHLCV bars at the requested granularity.

Data Pipeline

Index data is sourced from consolidated exchange feeds that disseminate real-time index values:
  • Tick-level collection: Raw index values are captured at tick granularity as they are published by the exchanges.
  • Bar aggregation: Tick data is aggregated into OHLCV bars at the requested timeframe (daily, hourly, or minute). Each bar captures the open (first tick), high (maximum), low (minimum), close (last tick), and a transaction count where applicable.
  • Snapshot data: Real-time snapshots provide the current index value, session high/low, open/close, and change metrics.

Coverage

  • Major U.S. indices: S&P 500 (I:SPX), Dow Jones Industrial Average (I:DJI), NASDAQ Composite (I:COMP), Russell 2000 (I:RUT), VIX (I:VIX), and many more.
  • Sector and thematic indices: Technology, healthcare, energy, and other sector-specific indices.
  • Daily history: Extensive historical data varying by index.
  • Intraday: Minute and hourly bars available during market hours.

Supported Modes

ModeTriggerNotes
Daily historicalstart/end as 'YYYY-MM-DD'Timeframe defaults to 'day'.
Intraday historicalstart/end as 'YYYY-MM-DDTHH:MM:SS'Timeframe defaults to 'min'; can set 'hour'.

Ticker Convention

Indices use the I: prefix. Legacy ^ prefix is also accepted and automatically translated.
TickerIndex
I:SPXS&P 500
I:DJIDow Jones Industrial Average
I:COMPNASDAQ Composite
I:RUTRussell 2000
I:VIXCBOE Volatility Index (VIX)
I:NDXNASDAQ-100

Querying the Data

Basic Usage

from scalarlib import getOHLCV

# Daily S&P 500 bars
data = getOHLCV(tickers=['I:SPX'], start='2025-01-01', end='2025-12-31')
spx_df = data['I:SPX']

# Multiple indices
data = getOHLCV(tickers=['I:SPX', 'I:DJI', 'I:VIX'], start='2025-01-01', end='2025-06-30')

# Intraday minute bars
data = getOHLCV(tickers=['I:SPX'], start='2026-03-24T09:30:00', end='2026-03-24T16:00:00')

# Hourly bars
data = getOHLCV(tickers=['I:VIX'], start='2026-03-20', end='2026-03-24', timeframe='hour')

Parameters

ParameterTypeRequiredDescription
tickerslist of strYesIndex tickers with I: prefix (e.g., ['I:SPX', 'I:VIX']).
startstrYesStart date ('YYYY-MM-DD') or datetime ('YYYY-MM-DDTHH:MM:SS').
endstrYesEnd date or datetime (same format as start).
timeframestrNo'day', 'min', or 'hour'. Default: inferred from date format.

Column Definitions

OHLCV Schema

ColumnTypeDescription
ts_recvdatetime64[ns]Bar timestamp. For daily bars, the trading date. For intraday, the bar’s start time in New York time.
tickerstringIndex ticker (e.g., I:SPX).
openfloat64Opening index value of the bar.
highfloat64Highest index value during the bar.
lowfloat64Lowest index value during the bar.
closefloat64Closing index value of the bar.
volumefloat64Transaction count or notional volume (where available; may be 0 for pure index calculations).