Reputation: 9
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