Dear all,
I've used the macro from a site to calculate the maximum drawdown (a loss due to peak value vs. trough) for positive numbers. The macro can be found here:
http://investexcel.net/2450/maximum-drawdown-vba/
Now I've got a problem with this macro, as I need to calculate negative for a sample with both positive and negative numbers. I adapted the formula as:
temp = (TS(j,1) - TS(i,1)) / abs(TS(i,1))
But this is not right: a sample with 10, 20, -5, 8 will have a maximum drawdown of -150% using the macro. But the actual maximum drawndown should be: (-5-20)/20 = -125%, which is the loss from the peak 20 to the trough -5.
Is there any idea to adapt the original macro which is able to do the right calculation when there are negative numbers? I attached the file with macro here.
Thanks a lot in advance.
Bookmarks