INDEXDATA
Fetches a current or historical index price from Market Data.
Sample Usage
=INDEXDATA("SPX")
=INDEXDATA("SPX", "all")
=INDEXDATA("SPX", "close", "9/23/2022", "10/23/2022", "hourly")
=INDEXDATA("SPX", "all", TODAY()-30, 30)
Syntax
=INDEXDATA(symbol, [historial attribute|quote attribute], startDate, endDate, resolution)
-
symbol (REQUIRED) The index symbol, without any leading or trailing index identifiers. For example, use DJI do not use $DJI, ^DJI, .DJI, DJI.X, etc.
-
[historial attributes | quote attributes] (Optional) Use a historical or quote attribute:
-
historical attributes (OPTIONAL – "close" by default) Use one of the following attributes when requesting historical candles:
"open"
– The opening price of the index."high"
– The high price of the index."low"
– The low price of the index."close"
– The closing price of the index."date"
- The date/time of the candle."all"
– Returns all values.
-
quote attributes (OPTIONAL – "mid" by default) Use one of the following attributes when requesting a quote:
"price"
,"mid"
,"mark"
,"last"
– The price of the index."date"
- The date/time of the index quote."all"
– Returns all values.
-
-
startDate (OPTIONAL) The start date when fetching historical data. If start date is specified, but endDate is not, only the single day’s data is returned.
-
endDate (OPTIONAL) The end date when fetching historical data, or the number of calendar days (not trading days) from startDate for which to return data.
-
resolution (OPTIONAL) The duration of each candle when fetching historical candles. Daily resolution is default if no value is specified. Use one of the following resolutions:
- Minutely Resolutions: (minutely, 1, 3, 5, 15, 30, 45, ...)
- Hourly Resolutions: (hourly, H, 1H, 2H, ...)
- Daily Resolutions: (daily, D, 1D, 2D, ...)
- Weekly Resolutions: (weekly, W, 1W, 2W, ...)
- Monthly Resolutions: (monthly, M, 1M, 2M, ...)
- Yearly Resolutions: (yearly, Y, 1Y, 2Y, ...)
Notes
- All parameters must be enclosed in quotation marks or be references to cells containing text. A possible exception is when endDate is specified as a number of days.
- Real-time or current day results will be returned as a value within a single cell unless specific attributes are requested. Historical data, even for a single day, will be returned as an expanded array with column headers.
- If any date parameters are specified, the request is considered historical and only the historical attributes are allowed.
- Dates and times are returned in the same timezone of the exchange.