\HeaderA{findDrawdowns}{Find the drawdowns and drawdown levels in a timeseries.}{findDrawdowns}
\aliasA{Drawdowns}{findDrawdowns}{Drawdowns}
\keyword{ts}{findDrawdowns}
\keyword{multivariate}{findDrawdowns}
\keyword{distribution}{findDrawdowns}
\keyword{models}{findDrawdowns}
\begin{Description}\relax
\code{findDrawdowns} will find the starting period, the ending period, and the amount and length of the drawdown.

Often used with \code{\LinkA{sortDrawdowns}{sortDrawdowns}} to get the largest drawdowns.

\code{Drawdowns} will calculate the drawdown levels as percentages, for use in \code{\LinkA{chart.Drawdown}{chart.Drawdown}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
findDrawdowns(R)
Drawdowns(R)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{R}] an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns 
\end{ldescription}
\end{Arguments}
\begin{Value}
unordered list \\
\begin{ldescription}
\item[\code{return }] depth of drawdown
\item[\code{from }] starting period
\item[\code{to }] ending period
\item[\code{length }] length in periods
\end{ldescription}
\end{Value}
\begin{Author}\relax
Peter Carl

\code{findDrawdowns} modified with permission from function by Sankalp Upadhyay
\end{Author}
\begin{References}\relax
Bacon, C. \emph{Practical Portfolio Performance Measurement and Attribution}. Wiley. 2004. p. 88 \\
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{sortDrawdowns}{sortDrawdowns}} \\
\code{\LinkA{maxDrawdown}{maxDrawdown}} \\
\code{\LinkA{sortDrawdowns}{sortDrawdowns}} \\
\code{\LinkA{table.Drawdowns}{table.Drawdowns}} \\
\code{\LinkA{table.DownsideRisk}{table.DownsideRisk}} \\
\code{\LinkA{chart.Drawdown}{chart.Drawdown}} \\
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(edhec)
findDrawdowns(edhec[,"Funds of Funds", drop=FALSE])
sortDrawdowns(findDrawdowns(edhec[,"Funds of Funds", drop=FALSE]))
\end{ExampleCode}
\end{Examples}

