calculate_cumulative_returns: calculate_cumulative_returns

View source: R/calculate_cumulative_returns.R

calculate_cumulative_returnsR Documentation

calculate_cumulative_returns

Description

Calculates the cumulative return for each column of an xts.

Usage

calculate_cumulative_returns(rets_xts)

Arguments

rets_xts

xts, an xts of asset returns

Details

A minimal PerformanceAnalytics::Return.cumulative().

Value

A matrix displaying the cumulative return for each column of returns.

Examples

## Not run: 
if(interactive()){
 quantmod::getSymbols('SPY')
 SPY[,4] %>%
   {. / stats::lag(.) - 1} %>%
   stats::na.omit() %>%
   clhelpers::calculate_cumulative_returns()
 }

## End(Not run)

causality-loop/clhelpers documentation built on Aug. 31, 2022, 3:39 a.m.