1
$\begingroup$

I would like to verify my approach of calculating the Maximum Drawdown for a portfolio in MATLAB.

I've got a vector of returns for the portfolio, to which I add 1 for every return. Afterwards I calculate the cumulative product of this series in order to get a plot of how the portfolio develops over time with the function cumprod().

Is it correct to use the function maximumdrawdown() of this portfolio development to get the Maximum Drawdown of the portfolio?

Best regards

$\endgroup$
  • $\begingroup$ As I remember from my course in Numerical Methods, if you have a good process for X(t), you can derive the distribution of MDD(T) and have an exact formula for it (a theoretical MDD). It may be different from empirical MDD, which you calculate from the data. $\endgroup$ – David Nguyen Apr 28 at 9:48
  • 1
    $\begingroup$ You should check mathworks. I recently used a function to calculate maximum drawdown using as input the price series vector. $\endgroup$ – alexbougias Apr 30 at 22:26
2
$\begingroup$

Max drawdown of a portfolio is the loss relative to a previous high-water mark. It's typically calculated as you describe, calculating cumulative performance and maxDD relative to the previous equity peak.

I'm not aware of a built-in Matlab function (speaking as someone that built a backtesting suite in Matlab years back, including max DD by hand), so can't comment if you're speaking about a particular function with your concluding question.

$\endgroup$
2
$\begingroup$

Depending on your version:

Matlab 2019 https://www.mathworks.com/help/finance/maxdrawdown.html

Matlab 2018 or before https://in.mathworks.com/matlabcentral/fileexchange/10367-maximum-drawdown

The latter is a user-defined function and not a built-in by MathWorks. The developer is Andreas Steiner.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.