I don’t know why max drawdown is not correctly calculated in probacktest
I have the most simplebuy and hold strategy on SPY.
Buy 1 january 1998 and sell today
accordingly to the generated result the max drawdown is only 24.5% that it is clearly wrong considering the big downs of years 2000 and 2008
Any idea why the drawdown is wrong?
code
DEFPARAM CumulateOrders = False
buy (100000/close) shares at market
Thanks in advance!
JSParticipant
Veteran
Personally, I think a “Drawdown” of 24.5% ($-141,467.75) is a decent “Drawdown”…
The calculation of the maximum “Drawdown” is always relative to the maximum “Runup”…
%Drawdown = Max. Drawdown / Max. Runup * 100
%Drawdown = 141.467,75 / 578.765,00 * 100 = 24,5%
Hi,
In my opinion the DD% is not correctly calcultated.
See attached image.
defparam cumulateorders = false
capini = 100000
buy capini/close shares at market
if not onmarket then
mystrategyprofit=strategyprofit
elsif longonmarket then
mystrategyprofit=strategyprofit+(close-tradeprice)/pointsize*pointvalue*countoflongshares
endif
equitycurve = mystrategyprofit+capini
//Maxrun
if equitycurve > maxrun then
maxrun = equitycurve
else
maxrun = maxrun
endif
//Drawdown
DD=equitycurve-maxrun
DDp = DD/maxrun*100
if DDp < maxDDp then
maxDDp = DDp
else
maxDDp = maxDDp
endif
//graph equitycurve
//graph maxrun as "maxrun" coloured("blue")
graph DDp as "DD %" coloured("blue")
graph maxDDp as "Max DD" coloured("red")
graph 0
Hi all,
“%Drawdown = 141.467,75 / 578.765,00 * 100 = 24,5%”
This is not correct, result is not 24,5%, is 24,42% instead, this is not how this %MaxDD is calculated
24,5% is calculated from the absolute number of drawdown that is -141.467 $ that was a -24,5% at that point in time considering the current balance of the system at that point in time, but this is not the definition of a max drawdown, max drawdown should not consider absolute numbers or be dependant of your balance at that point in time, should work with %’s
I agree with Ivan, MaxDD for this strategy should be -56,58% as you can see in Ivan’s attachment.
In my opinion this value is not correct at all.
Thanks for your answers!
For your information, numerous fixes have been made to this problem, but they are not yet deployed on the IG side, but should be available next week.