investment-performance.com
Go Back   investment-performance.com > Hosted Forums > CompoundingHappens.com
User Name
Password
Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 22nd November 2007, 06:47
alexm alexm is offline
IP Junior
 
Join Date: Nov 2007
Posts: 1
Default calculating max drawdown

Hi,

I am trying to build a calculator for a high school computer project similar to this one: http://www.performance-measurement.org/performance.php

However the max drawdown function there does not seem to work (I have contacted the author but have not heard from him yet). I put in: 90, 80, 70, 60, 45, 55, 65, 90, 100, 95, 80, 110

So the max drawdown should be 50 % but it returns zero. I am having problems in finding a decent formula to properly compute max drawdown. Maybe someone in this forum could help. I am also trying to find a workable formula for drawdown analysis which returns depth, length, recovery as well as start and end date.

I also tried to calculate the highest and lowest 12 months in a record, but again I am struggling to find an easy to implement formula.

Thanks in advance.
Reply With Quote
  #2  
Old 22nd November 2007, 15:41
Damien Laker Damien Laker is offline
IP Super Moderator
 
Join Date: Jul 2005
Posts: 266
Default Advice from an old fogey

It makes me feel very old to say this, but what you are seeking is definitely an algorithm, not a formula. The bit that makes me feel very old is that I finished my computer science degree a quarter of a century ago. I can imagine Abe Simpson (Bart's Grandpa) saying this, but in my day, this is the sort of problem that we would have solved by writing an algorithm in Pascal using pencil and paper. Honestly, I can see the outline of the solution now. It involves 2 or 3 subroutines, and a bit of iteration in the main procedure -- most likely one for loop nested inside another, like:

for integer i = 1 to n
{
__for integer j = i to n
__{
__// This is where the main body of the logic would go.
__}
}

Yes, I know this is not Pascal. You can use any sensible notation to describe your algorithm. The leading underscores are simply because this discussion group software doesn't seem to like leading spaces or tabs.

I don't think there is any difficult performance analysis knowledge in this problem. Anybody bright enough to write the algorithm should be able to figure out that bit by themselves.

[Lapsing completely into Abe Simpson character...]
We used to solve a dozen problems like this in a one-hour tutorial. And we were grateful. :-)
__________________
Damien Laker is one of the world's leading authorities in performance analytics. For more information visit Moderators

Last edited by Damien Laker : 22nd November 2007 at 15:45. Reason: Leading spaces were discarded by the editor.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT -5. The time now is 15:29.


Powered by: vBulletin Version 3.0.1
© investment-performance.com 2004