I have a column of dates and monthly percentages. To find the maximum drawdown I would (in excel) make another column of numbers which is the running total of percentages and then I would locate anywhere the running total goes down. The largest drawdown would be measured from running total down, and I would look at the largest spread.
Example
if the string of percentages (note: 1% = 1.01, -1%=0.99)
1.01
.95
.99
1.02
.91
so in this string of dates it up, down, down, up, down
the drawdown would 12.8 %, because the running total is seen in second column, never gets back to 1.01.
1.01 1.01
0.95 0.9595
0.99 0.949905
1.02 0.9689031
0.91 0.881701821
And the difference between 1.01 and .8817 is ~.128 or 12.8 %
I am using the following code to find maximum consecutive months down, but that is different than this, as the 1.02 would reset it
Private Sub Calculate()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblDrawdowns")
MinProd = 1
CrtProd = 1
While Not rs.EOF
If Nz(rs!cc_rt, 1) >= 1 Then
If CrtProd <> 1 Then
If MinProd > CrtProd Then MinProd = CrtProd
End If
CrtProd = 1
Else
CrtProd = CrtProd * rs!cc_rt
End If
rs.MoveNext
Wend
If CrtProd <> 1 Then
If MinProd > CrtProd Then MinProd = CrtProd
End If
Debug.Print (MinProd - 1) * 100
End Sub
Example
if the string of percentages (note: 1% = 1.01, -1%=0.99)
1.01
.95
.99
1.02
.91
so in this string of dates it up, down, down, up, down
the drawdown would 12.8 %, because the running total is seen in second column, never gets back to 1.01.
1.01 1.01
0.95 0.9595
0.99 0.949905
1.02 0.9689031
0.91 0.881701821
And the difference between 1.01 and .8817 is ~.128 or 12.8 %
I am using the following code to find maximum consecutive months down, but that is different than this, as the 1.02 would reset it
Private Sub Calculate()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("tblDrawdowns")
MinProd = 1
CrtProd = 1
While Not rs.EOF
If Nz(rs!cc_rt, 1) >= 1 Then
If CrtProd <> 1 Then
If MinProd > CrtProd Then MinProd = CrtProd
End If
CrtProd = 1
Else
CrtProd = CrtProd * rs!cc_rt
End If
rs.MoveNext
Wend
If CrtProd <> 1 Then
If MinProd > CrtProd Then MinProd = CrtProd
End If
Debug.Print (MinProd - 1) * 100
End Sub