Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

SQL Server maximum drawdown of asset returns


Updated: 09 May 2014

Use MAXDD to calculate the maximum drawdown based on net asset or portfolio values. The inputs into the function are dates and values and the maximum drawdown is calculated as the largest percentage drop in the asset values from peak to trough in chronological order.
Syntax for XLeratorDB MAXXDD maximum drawdown function for SQL Server
The date associated with @PValue. @PDate is an expression of type datetime or of a type that can be implicitly converted to datetime.
the net asset or portfolio value. @PValue is an expression of type float or of a type that can be implicitly converted to float.
Return Type
·         Returns are calculated by sorting @PValue in chronological order based on @PDate and calculating the largest percentage drop from peak to trough.
·         Available in XLeratorDB / financial 2008 only
In this example we have portfolio values from 2011-12-31 to 2014-12-31 and we want to calculate the maximum drawdown.
      wct.MAXDD(pdate,pvalue) as [Max Drawdown]
This produces the following result.
          Max Drawdown
Here is a graphical representation of the solution:
As you can see from the graph, the largest percentage drop was from a peak of 131.30 on 2012-12-31 to a trough of 65.05 on 2013-03-31 (-50.5%). Even though there was higher peak of 143.82 on 2013-11-30, the trough of 82.25 on 2014-12-31 is a drawdown of only -42.8%. 


See Also


Copyright 2008-2023 Westclintech LLC         Privacy Policy        Terms of Service