\HeaderA{chart.RollingPerformance}{wrapper to create a chart of rolling performance metrics in a line chart}{chart.RollingPerformance}
\keyword{ts}{chart.RollingPerformance}
\keyword{multivariate}{chart.RollingPerformance}
\keyword{distribution}{chart.RollingPerformance}
\keyword{models}{chart.RollingPerformance}
\keyword{hplot}{chart.RollingPerformance}
\begin{Description}\relax
A wrapper to create a chart of rolling performance metrics in a line chart
\end{Description}
\begin{Usage}
\begin{verbatim}
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.axis=0.8, cex.legend = 0.8, cex.labels = 0.7, lwd = 2, xlim = NULL, ylim = NULL, log = "", main = NULL, sub = NULL, xlab = "Date", 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", element.color = "darkgray", major.ticks='auto', minor.ticks=TRUE, grid.color="lightgray", grid.lty="dotted", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{R}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\item[\code{width}] number of periods to apply rolling function window over 
\item[\code{FUN}] any function that can be evaluated using a single set of returns (e.g., rolling \code{\LinkA{CAPM.beta}{CAPM.beta}} won't work, but \code{\LinkA{Return.annualized}{Return.annualized}} will) 
\item[\code{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. 
\item[\code{ylog}] TRUE/FALSE set the y-axis to logarithmic scale, similar to \code{\LinkA{plot}{plot}}, default FALSE 
\item[\code{legend.loc}] places a legend into one of nine locations on the chart: bottomright, bottom, bottomleft, left, topleft, top, topright, right, or center. 
\item[\code{main}] set the chart title, same as in \code{\LinkA{plot}{plot}} 
\item[\code{event.lines}] If not null, vertical lines will be drawn to indicate that an event happened during that time period.  \code{event.lines} should be a list of dates (e.g., \code{c("09/03","05/06"))} formatted the same as date.format.  This function matches the re-formatted row names (dates) with the events.list, so to get a match the formatting needs to be correct. 
\item[\code{event.labels}] if not null and event.lines is not null, this will apply a list of text labels (e.g., \code{c("This Event", "That Event")} to the vertical lines drawn 
\item[\code{event.color}] draws the event described in \code{event.labels} in the color specified 
\item[\code{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., \code{list(c("10/26","11/27"), c("08/29","03/33"))} See the examples below. 
\item[\code{period.color}] draws the shaded region described by \code{period.areas} in the color specified 
\item[\code{type}] set the chart type, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xaxis}] if true, draws the x axis 
\item[\code{ylab}] set the y-axis label, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlab}] set the x-axis label, same as in \code{\LinkA{plot}{plot}} 
\item[\code{xlim}] set the x-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{ylim}] set the y-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{pch}] symbols to use, see also \code{\LinkA{plot}{plot}} 
\item[\code{lty}] set the line type, same as in \code{\LinkA{plot}{plot}} 
\item[\code{lwd}] set the line width, same as in \code{\LinkA{plot}{plot}} 
\item[\code{colorset}] color palette to use, set by default to rational choices 
\item[\code{bg}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{cex}] set the y-axis limit, same as in \code{\LinkA{plot}{plot}} 
\item[\code{log}] not used 
\item[\code{sub}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{ann}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{axes}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{frame.plot}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{panel.first}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{panel.last}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{asp}] same as in \code{\LinkA{plot}{plot}} 
\item[\code{cex.axis}] The magnification to be used for axis annotation relative to the current setting of 'cex', same as in \code{\LinkA{plot}{plot}}.  
\item[\code{cex.legend}] The magnification to be used for sizing the legend relative to the current setting of 'cex'.  
\item[\code{cex.labels}] The magnification to be used for event line labels relative to the current setting of 'cex'.  
\item[\code{major.ticks}] Should major tickmarks be drawn and labeled, default 'auto'
\item[\code{minor.ticks}] Should minor tickmarks be drawn, default TRUE
\item[\code{grid.color}] sets the color for the reference grid 
\item[\code{grid.lty}] defines the line type for the grid 
\item[\code{element.color}] provides the color for drawing chart elements, such as the box lines, axis lines, etc. Default is "darkgray" 
\item[\code{...}] any other passthru parameters to \code{\LinkA{rollapply}{rollapply}} 
\end{ldescription}
\end{Arguments}
\begin{Value}
A timeseries line chart of the calculated series
\end{Value}
\begin{Author}\relax
Peter Carl
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{charts.RollingPerformance}{charts.RollingPerformance}}, \code{\LinkA{rollapply}{rollapply}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
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")
\end{ExampleCode}
\end{Examples}

