Results 1 to 8 of 8

Calculate maximum drawdown with negative numbers

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-15-2013
    Location
    London
    MS-Off Ver
    Excel 2003, 2007, 2010, 2019, Microsoft 365.
    Posts
    440

    Calculate maximum drawdown with negative numbers

    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.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1