Calculate the maximum drawdown (MaxDD
) using example data with a fund, market, and cash series:
MaxDD =1×30.1658 - 0.3381 0
The maximum drop in the given time period was 16.58% for the fund series, and 33.81% for the market series. There was no decline in the cash series, as expected, because the cash account never loses value.
maxdrawdown
also returns the indices (MaxDDIndex
) of the maximum drawdown intervals for each series in an optional output argument.
MaxDD =1×30.1658 - 0.3381 0
MaxDDIndex =2×32 2 NaN 18 18 NaN
The first two series experience their maximum drawdowns from the second to the 18th month in the data. The indices for the third series areNaN
s because it never has a drawdown.
The 16.58% value loss from month 2 to month 18 for the fund series is verified using the reported indices.
ans = 0.1658
Although the maximum drawdown is measured in terms of returns,maxdrawdown
can measure the drawdown in terms of absolute drop in value, or in terms of log-returns. To contrast these alternatives more clearly, you can work with the fund series, assuming an initial investment of 50 dollars:
First, compute the standard maximum drawdown, which coincides with the results above because returns are independent of the initial amounts invested.
Next, compute the maximum drop in value, using the'arithmetic'
argument.
The value of this investment was $50.84 in month 2, but by month 18 the value was down to $42.41, a drop of $8.43. This is the largest loss in dollar value from a previous high in the given time period. In this case, the maximum drawdown period, from the 2nd to 18th month, is the same independently of whether drawdown is measured as return or as dollar value loss.
Note, the last measure is equivalent to finding the arithmetic maximum drawdown for the log of the series.