defaultBacktestFunctions: User defined functions to perform portfolio backtesting

Description Usage Arguments Details Value References Examples

Description

Default windows, strategy and smoothing functions used for portfolio backtesting.

Usage

1
2
3
4
5
6
equidistWindows(data, backtest = portfolioBacktest())

tangencyStrategy(data, spec = portfolioSpec(), constraints = "LongOnly", 
    backtest = portfolioBacktest())
    
emaSmoother(weights, spec, backtest)

Arguments

data

a multivariate time series described by an S4 object of class timeSeries. If your timeSerie is not a timeSeries object, consult the generic function as.timeSeries to convert your time series.

backtest

an S4 object of class fPFOLIOBACKTEST as returned by the function portfolioBacktest.

spec

an S4 object of class fPFOLIOSPEC as returned by the function portfolioSpec.

constraints

a character string vector, containing the constraints of the form
"minW[asset]=percentage" for box constraints resp.
"maxsumW[assets]=percentage" for sector constraints.

weights

a numeric vector, containing the portfolio weights of an asset

Details

equidistWindows:

Defines equal distant rolling windows.

The function requires two arguments: data and backtest, see above. To assign the horizon value to the backtest specification structure, use the function setWindowsHorizon.

tangencyStrategy:

A pre-defined tangency portfolio strategy.

The function requires four arguments: data, spec, constraints and backtest, see above.

emaSmoother:

A pre-defined weights smoother (EMA) for portfolio backtesting.

The function requires three arguments: weights, spec and backtest, see above. To assign initial starting weights, smoothing parameter (lambda) or whether to perform double smoothing to the backtest specification structure, use the functions setSmootherInitialWeights, setSmootherLambda and setSmootherDoubleSmoothing, respectively.

Value

equidistWindows
function returns the "from" and "to" dates of the rolling window in a list form.

tangencyStrategy
function returns a S4 object of class "fPORTFOLIO".

emaSmoother
function returns a numeric vector of smoothed weights.

References

W\"urtz, D., Chalabi, Y., Chen W., Ellis A. (2009); Portfolio Optimization with R/Rmetrics, Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.

Examples

1
2
3
4
5
6
7
8
## Show default rolling windows function - 
   equidistWindows

## Show default portfolio strategy function -
   tangencyStrategy

## Swhow default weights smoother function -   
   emaSmoother

fPortfolioBacktest documentation built on May 2, 2019, 5:23 p.m.