portfolioBacktesting: Portfolio backtesting

Description Usage Arguments References Examples

Description

Tests a portfolio by a rolling backtest.

Usage

1
2
3
4
5
6
  
portfolioBacktesting(formula, data, spec = portfolioSpec(), 
    constraints = "LongOnly", backtest = portfolioBacktest(), 
    trace = TRUE)

portfolioSmoothing(object, backtest, trace = TRUE)    

Arguments

formula

a formula describing the benchmark and assets used for backtesting in the form backtest ~ assetA + ... + assetZ. Here, backtest and asset* are column names of the data set.

data

an object of class timeSeries.

spec

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

constraints

a character string value or vector defining the constraints, for details we refer to portfolioConstraints.

backtest

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

object

a list as returned by the function portfolioBacktesting.

trace

a logical flag, by default TRUE. Should the backtersting be traced?

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
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Specifications - 
   swxData <- 100 * SWX.RET 
   swxSpec <- portfolioSpec()
   swxBacktest <- portfolioBacktest()
   setWindowsHorizon(swxBacktest) = "18m"
   swxFormula <- LP40 ~ SBI + SPI + SII

## Portfolio Backtesting -
   portfolios <- portfolioBacktesting(
     formula = swxFormula, 
     data = swxData, 
     spec = swxSpec, 
     constraints = "LongOnly", 
     backtest = swxBacktest, 
     trace = TRUE)

## Smoothed Rebalancing -   
   smoothedPortfolios <- portfolioSmoothing(
     object = portfolios, 
     backtest = swxBacktest,
     trace = TRUE)     

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