I think this version is more practical and quite better than Steiner's. Also, is faster since it does not computes the whole drawdown vector (which I don't need in particular) and its more understandable. Advantage vs. MATLAB's routine: data can be <= 0, and still computes (i.e. MaxDD = 120%, for instance).
The input for your function is a vector of cummulative returns, not a period return vector. You should point that out in your description of the arguments.
Personally, I prefer my version because it allos not only computation of maximum drawdown, but computation of the full drawdown vector to for example plot time-under-water charts and calculation of the average of the n-th largest drawdowns (needed in the calc of certain risk-adjusted performance measures).
It is a very useful utility. Is it possible to list the actual parameters passed to each function call (not just the formal parameters used in the function definition)? Note that this may vary across calls to the same function. Thanks.
unlike FARG, M2HTML dose not
- distinguish between subfunctions and nested functions
- extract anonymous functions
- extract f/eval constructs
moreover, it is a standalone function that does not require other files and subfolders nor the web browser to display its result
just a few pedestrian thoughts...