backtestPlot: Portfolio backtesting plots

Description Usage Arguments Details References Examples

Description

Creates and displays plots of cumulative assets returns, of portfolio weights, of rebalanced weights, of drawdowns and of a report summary for backtesting.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

Arguments

object

a list, returned from running the function portfolioSmoothing.

which

an integer or string value. If the argument is an integer then it specifies which backtest plot should be displayed. If the argument take the character value all, which is the default, then all 6 available backtest plots will be displayed.

labels

a logical flag, determining if the the graph should be labeled automatically, which is the default case labels=TRUE. If set to FALSE then the graph will be displayed undecorated and the user can it decorate by himself.

...

additional arguments passed to the function plot

Details

These backtest plot summarises the results obtained from portfolio backtesting.

The function backtestAssetsPlot displays the set of possible assets to construct a portfolio.

The function backtestWeightsPlot displays the recommended weights for investment.

The function backtestRebalancePlot displays the weight changes over time for individual assets and for the portfolio.

The function backtestPortfolioPlot displays the daily, benchmark and portfolio series of a portfolio backtest.

The function backtestDrawdownPlot displays the daily drawdowns for the benchmark and the portfolio.

The function backtestReportPlot summarises the results from a portfolio backtest.

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
22
23
24
25
26
27
28
29
30
31
## 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 Rebalnacing -   
   smoothedPortfolios <- portfolioSmoothing(
     object = portfolios, 
     backtest = swxBacktest)  

## Typical Plots -
   backtestAssetsPlot(smoothedPortfolios)
   backtestWeightsPlot(smoothedPortfolios)
   backtestRebalancePlot(smoothedPortfolios)
   backtestPortfolioPlot(smoothedPortfolios)
   backtestDrawdownPlot(smoothedPortfolios)
   backtestReportPlot(smoothedPortfolios)  

## backtestPlot Summary:  
   backtestPlot(smoothedPortfolios)    

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