Back to Community
Beginner question

Hi guys!

Probably a silly question but according to this backtest...
Beginning of 2007 SPY is at 72.01%,
Beginning of 2008 SPY is at 78.66%
Beginning of 2009 SPY is at 13.95%

But the draw down SPY between 2008-2009 was less than 2009s beginning % subtracted from 2008s beginning %. Why is that?

Clone Algorithm
3
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5ad55ce78d8c384454a07cfa
There was a runtime error.
6 responses

Maybe of help here in looking into it, but be sure to check this code carefully. Before a run, click in margin on line numbers, to set breakpoints.
Now, one thing I noticed, the Risk Metrics tab here says -.01. The backtest -.84, while the custom chart would be -.24 unless I'm mistaken.
Founder on drawdown: https://www.quantopian.com/posts/calculation-of-cumulative-max-drawdown
Others: https://www.google.com/search?q=drawdown+site:quantopian.com

Clone Algorithm
2
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5ad56ebb8d8c384454a07e63
There was a runtime error.

Very interesting, thank you.

@Blue Seahawk I'm not sure I phrased my question correctly, how can the total return of SPY that peaks at 92% fall to -11% when the market fell about 1/2 of that?

Joshua,

Maximum Drawdown(MDD) is expressed in percentage terms and computed as:

MDD = (Trough Value – Peak Value) / Peak Value

What you see on the graph(1/1/2008 79.23%) is cumulative return.

To get value or equity you need to add initial investment (100%)

1/1/2008 Value = 79.23% + 100% = 179.23%

1/1/2009 Value = 13.95% + 100% = 113.95%

For the period from 1/1/2008 to 1/1/2009

MDD = ( 113.95% - 179.23%)/179.23% = -36.42% not (13.95% - 79.23% = -65.28%).

this was exactly what I needed. thank you so much

As runnable code for a drawdown value one can use for making decisions could be useful to some.