Klaus
Klaus

Reputation: 9

I am hoping to get some insight around ensuring I am pulling total returns and not just price returns using quantmod in R

I have a function:

get_monthly_returns <- function(ticker, start_date) {
  getSymbols(ticker, src = 'yahoo', from = start_date, auto.assign = TRUE)
  monthly_returns <- to.monthly(get(ticker), indexAt = "lastof", OHLC = FALSE)
  monthly_ret <- monthlyReturn(monthly_returns, type = 'arithmetic') # Using arithmetic
  colnames(monthly_ret) <- ticker
  return(monthly_ret)
}

I am worried I have only been pulling price returns using this function. I need to captured the adjusted column, I believe.

Does anyone know if the default 'monthlyReturn in quantmod is total return (TR) or price return (PR)?

I compared monthly returns to a commercial database and I am concerned I am only capturing PR

Upvotes: 0

Views: 29

Answers (0)

Related Questions