calculate_returns: calculate_returns

View source: R/calculate_returns.R

calculate_returnsR Documentation

calculate_returns

Description

Wrapper for TTR:ROC() but with easy periodicity changing.

Usage

calculate_returns(closes_xts)

Arguments

closes_xts

xts, an xts of closing prices

Value

An xts of asset returns.

Examples

## Not run: 
if(interactive()){
 quantmod::getSymbols('SPY')
 clhelpers::calculate_returns(SPY[,4])
 }

## End(Not run)

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