R/getTradingDays.R

Defines functions getTradingDays

getTradingDays <- function(start_date, end_date, type = "dt") {

  spy   <- getDailyOHLCV(settings$quotemedia.sqli, "SPY", start_date, end_date)
  aapl  <- getDailyOHLCV(settings$sharadar.sqli, "AAPL", start_date, end_date)
  dates <- spy[aapl, on = "date", all = TRUE][, .(date)]

  if (type == "vec") {
    dates <- dates$date
  }

  return (dates)
}
tmk-c/myrlib documentation built on May 29, 2019, 1:44 p.m.