Learn R Programming

PerformanceAnalytics (version 0.9.5)

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, xaxis = TRUE, legend.loc = NULL, colorset = (1:12), FUN = "Return.annualized", na.pad = TRUE, type = "l", pch = NULL, lty = 1, bg = NULL, cex = 1, lwd = 1, xlim = NULL, ylim = NULL, log = "", main = paste(width,"-Month Rolling Performance", sep=""), sub = NULL, xlab = NULL, ylab = NULL, ann = par("ann"), axes = TRUE, frame.plot = axes, panel.first = NULL, panel.last = NULL, asp = NA, ylog = FALSE, event.lines = NULL, event.labels = NULL, period.areas = NULL, event.color = "darkgray", period.color = "lightgray", darken = FALSE , date.format = "%m/%y", ...)

Arguments

R
a 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.
ylog
TRUE/FALSE set the y-axis to logarithmic scale, similar to plot, default FALSE
date.format
re-format the dates for the xaxis; the default is "%m/%y"
legend.loc
places a legend into one of nine locations on the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center.
main
set the chart title, same as in plot
event.lines
If not null, vertical lines will be drawn to indicate that an event happened during that time period. event.lines should be a list of dates (e.g., c("09/03","05/06")) formatted the same as date.format. This function matches the
event.labels
if not null and event.lines is not null, this will apply a list of text labels (e.g., c("This Event", "That Event") to the vertical lines drawn
event.color
draws the event described in event.labels in the color specified
period.areas
these are shaded areas described by start and end dates in the same format as the date.format. This is provided as a list of pairs, e.g., list(c("10/26","11/27"), c("08/29","03/33")) See the examples below.
period.color
draws the shaded region described by period.areas in the color specified
type
set the chart type, same as in plot
xaxis
if true, draws the x axis
ylab
set the y-axis label, same as in plot
xlab
set the x-axis label, same as in plot
xlim
set the x-axis limit, same as in plot
ylim
set the y-axis limit, same as in plot
pch
symbols to use, see also plot
lty
set the line type, same as in plot
lwd
set the line width, same as in plot
darken
if true, draws the chart elements in "darkgray" rather than "gray". Makes it easier to print for some printers.
colorset
color palette to use, set by default to rational choices
bg
~~Describe~~
cex
~~Describe~~
log
~~Describe~~
sub
~~Describe~~
ann
~~Describe~~
axes
~~Describe~~
frame.plot
~~Describe~~
panel.first
~~Describe~~
panel.last
~~Describe~~
asp
~~Describe~~
...
any other passthru parameters

Value

  • A timeseries line chart of the calculated series

See Also

charts.RollingPerformance

Examples

Run this code
data(edhec)
chart.RollingPerformance(edhec[, 1:3], width = 24)
chart.RollingPerformance(edhec[, 1:3], width = 24, colorset = rich8equal, lwd = 2, legend.loc = "topleft")

Run the code above in your browser using DataLab