expand_calendar: Expand the calendar time index

View source: R/Calendar.R

expand_calendarR Documentation

Expand the calendar time index

Description

Expands a calendar object returned from calendar to contain each timepoint for a given multiplier & timeframe combination for timeframes of of minute, hour, and day.

Usage

expand_calendar(cal, timeframe, multiplier, market_hours = TRUE)

Arguments

cal

(calendar)

timeframe

(character) For the v1 API, one of

  • 'tr'/'lt'/'trade'/'last_trade' For the last trade price. See Last Trade

  • 'qu'/'lq'/'quote'/'last_quote' For the last quote price. See Last Quote

  • 'm'/'min'`/`'minute' (multiplier can be 1/5/15)

  • 'd'/'day' (multiplier will be 1)

For the v2 IEX/SIP API the following timeframes are supported:

For the "p"/"polygon" API, multiplier can be any positive integer for any one of the following timeframe's:

  • 'm'/'min'/'minute'

  • 'h'/'hour'

  • 'd'/'day'

  • 'w'/'week'

  • 'M'/'mo'/'month' (Note capitalize M for month)

  • 'q'/'quarter'

  • 'y'/'year'

multiplier

For the v1 API, with 'minute' timeframe one of 1/5/15. Otherwise, defaults to 1. For the v2 API, multiplier can only be 1. For the "polygon" API, this can be any positive integer. Default 1.

market_hours

(logical) Return market hours only? Default TRUE


jagg19/AlpacaforR documentation built on July 3, 2023, 12:14 p.m.