Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

chart.RollingPerformance

wrapper to create a chart of rolling performance metrics in a line chart


Description

A wrapper to create a chart of rolling performance metrics in a line chart

Usage

chart.RollingPerformance(
  R,
  width = 12,
  FUN = "Return.annualized",
  ...,
  ylim = NULL,
  main = NULL,
  fill = NA
)

Arguments

R

an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns

width

number of periods to apply rolling function window over

FUN

any function that can be evaluated using a single set of returns (e.g., rolling CAPM.beta won't work, but Return.annualized will)

...

any other passthru parameters to plot or the function specified

ylim

set the y-axis limit, same as in plot

main

set the chart title, same as in plot

fill

a three-component vector or list (recycled otherwise) providing filling values at the left/within/to the right of the data range. See the fill argument of na.fill for details.

Details

The parameter na.pad has been deprecated; use fill = NA instead of na.pad = TRUE, or fill = NULL instead of na.pad = FALSE.

Author(s)

Peter Carl

See Also

Examples

if(!( Sys.info()[['sysname']]=="Windows") ){
# if on Windows, cut and paste this example
data(edhec)
chart.RollingPerformance(edhec[, 1:3], width = 24)
chart.RollingPerformance(edhec[, 1:3], 
		FUN = 'mean', width = 24, colorset = rich8equal, 
		lwd = 2, legend.loc = "topleft", 
		main = "Rolling 24-Month Mean Return")
chart.RollingPerformance(edhec[, 1:3], 
		FUN = 'SharpeRatio.annualized', width = 24, 
		colorset = rich8equal, lwd = 2, legend.loc = "topleft", 
		main = "Rolling 24-Month Sharpe Ratio")
}

PerformanceAnalytics

Econometric Tools for Performance and Risk Analysis

v2.0.4
GPL-2 | GPL-3
Authors
Brian G. Peterson [cre, aut, cph], Peter Carl [aut, cph], Kris Boudt [ctb, cph], Ross Bennett [ctb], Joshua Ulrich [ctb], Eric Zivot [ctb], Dries Cornilly [ctb], Eric Hung [ctb], Matthieu Lestel [ctb], Kyle Balkissoon [ctb], Diethelm Wuertz [ctb], Anthony Alexander Christidis [ctb], R. Douglas Martin [ctb], Zeheng 'Zenith' Zhou [ctb], Justin M. Shea [ctb]
Initial release
2020-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.