View source: R/calculate_cumulative_returns.R
calculate_cumulative_returns | R Documentation |
Calculates the cumulative return for each column of an xts.
calculate_cumulative_returns(rets_xts)
rets_xts |
xts, an xts of asset returns |
A minimal PerformanceAnalytics::Return.cumulative()
.
A matrix displaying the cumulative return for each column of returns.
## Not run: if(interactive()){ quantmod::getSymbols('SPY') SPY[,4] %>% {. / stats::lag(.) - 1} %>% stats::na.omit() %>% clhelpers::calculate_cumulative_returns() } ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.