Description Usage Arguments Details References Examples
Creates and displays plots of cumulative assets returns, of portfolio weights, of rebalanced weights, of drawdowns and of a report summary for backtesting.
1 2 3 4 5 6 7 8 9 10 11 12 |
backtestPlot(object, which = "all", labels = TRUE, ...)
backtestAssetsPlot(object, labels = TRUE, ...)
backtestWeightsPlot(object, labels = TRUE, ...)
backtestRebalancePlot(object, labels = TRUE, ...)
backtestPortfolioPlot(object, labels = TRUE, ...)
backtestDrawdownPlot(object, labels = TRUE, ...)
backtestReportPlot(object, ...)
|
object |
a list, returned from running the function
|
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 |
labels |
a logical flag, determining if the the graph should be labeled
automatically, which is the default case |
... |
additional arguments passed to the function |
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.
W\"urtz, D., Chalabi, Y., Chen W., Ellis A. (2009); Portfolio Optimization with R/Rmetrics, Rmetrics eBook, Rmetrics Association and Finance Online, Zurich.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.