powered by
Used by ichimoku to subset a vector of dates to trading days.
ichimoku
tradingDays(x, holidays, ...)
A vector of logical values: TRUE if the corresponding element of
‘x’ is a weekday and not a holiday, FALSE otherwise.
Or, if the parameter ‘holidays’ is set to NULL, a vector of TRUE values of the same length as ‘x’.
a vector of POSIXct date objects.
(optional) a vector, or function which outputs a vector, of dates defined as holidays. Set to NULL for a continuously-traded market.
other arguments not used by this function.
New Year's Day (01-01) and Christmas Day (12-25) are defined as holidays by default if ‘holidays’ is not specified.
dates <- seq(from = as.POSIXct("2020-01-01"), by = "1 day", length.out = 7) dates tradingDays(dates) tradingDays(dates, holidays = c("2020-01-02", "2020-01-03")) tradingDays(dates, holidays = NULL)
Run the code above in your browser using DataLab