Time series (OHLCV)

Intra-day time series

An intra-day time series is the historical price performance of an asset at intervals less than one day. Use the SF_TIMESERIES() function and set the period argument to the desired interval, such as "1min" or "1hour".

=SF_TIMESERIES(symbol, startDate, endDate, period, metric, options)
  • symbol is the stock or coin ticker symbol, either as a cell reference or a string (e.g. "AAPL").

  • startDate and endDate are in ISO format YYYY-MM-DD.

  • period set to one of the intra-day intervals listed below.

  • metric selects which data to return. Leave blank or use "all" to return every metric.

  • options format the output. Use "-" for descending order and "NH" for no header.

=SF_TIMESERIES("AAPL", "2023-02-01", "2023-02-25", "1hour", "all")

Intra-day intervals

The supported intra-day intervals are:

  • 1 minute ("1min")

  • 5 minutes ("5min")

  • 15 minutes ("15min")

  • 30 minutes ("30min")

  • 1 hour ("1hour")

  • 4 hours ("4hour")

Maximum date ranges

Intra-day time series are constrained to a maximum range of dates. If your requested range is larger than the maximum, the output will be constrained to the maximum range using the endDate as the reference (i.e. startDate will be ignored and the endDate will be the last entry).

  • 1 minute ("1min") — 3 days

  • 5 minutes ("5min") — 7 days

  • 15 minutes ("15min") — 2 months

  • 30 minutes ("30min") — 1 month

  • 1 hour ("1hour") — 3 months

  • 4 hours ("4hour") — 3 months

Intra-day metrics

The available intra-day metrics are:

  • All ("all")

  • Date (with time) ("date")

  • Open ("open")

  • High ("high")

  • Low ("low")

  • Close ("close")

  • Volume ("volume")

Intra-day metrics do not include adjClose, unadjustedVolume, change, changePercent, or vwap.

Intraday Time series Example

Examples

1 minute interval, last 3 days

=SF_TIMESERIES("AAPL", TODAY()-3, TODAY(), "1min", "all")
Intraday Time series Example 1

1 hour interval, specific metrics

=SF_TIMESERIES("AAPL", "2023-01-01", "2023-03-01", "1hour", "date&open&close&volume")
Intraday Time series Example 2

5 minute interval, last 2 weeks, no header and reversed

=SF_TIMESERIES("AAPL", TODAY()-14, TODAY(), "5min", "date&open&close&volume", "-&NH")
Intraday Time series Example 3

Sheet space: This function returns multiple rows. If any cell in the target range already contains data, you will see a #REF! error: "Array result was not expanded because it would overwrite data in XX". Clear the area before entering the function.

Was this helpful?