Learn R Programming

PerformanceAnalytics (version 1.0.4.4)

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", ..., na.pad = TRUE, ylim = NULL, main = NULL)

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)
na.pad
TRUE/FALSE If TRUE it adds any times that would not otherwise have been in the result with a value of NA. If FALSE those times are dropped.
main
set the chart title, same as in plot
ylim
set the y-axis limit, same as in plot
...
any other passthru parameters to plot or the function specified

See Also

charts.RollingPerformance, rollapply

Examples

Run this code
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")

Run the code above in your browser using DataLab