Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
4 registered members (AndrewAMD, fogman, Grant, juanex), 972 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Drawdown #425022
06/25/13 16:39
06/25/13 16:39
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
I am a bit confused.
The manual says: "Maximum drawdown, the difference between the highest balance peak and the lowest subsequent equity valley"
I have a strategie with a DD of 1001$.
Now I plotted the Balance and the Equity curve and there is no greater difference than 200$ between the Balance and the Equity at any given time.

Re: Drawdown [Re: blaub4r] #425028
06/25/13 17:23
06/25/13 17:23
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Drawdown is not the difference between the Balance and the Equity at any given time. It is the difference between the _highest_ balance peak and the _lowest_ subsequent equity valley.

Re: Drawdown [Re: jcl] #425049
06/25/13 20:57
06/25/13 20:57
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
Ok, but this does not make much difference in my case as the balance hardly goes down. There is still only the 200$ difference.
I have a screenshot, but I'm not sure about how to upload it as I get asked for an URL.

Re: Drawdown [Re: blaub4r] #425066
06/26/13 07:24
06/26/13 07:24
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Can you post the script, if it's not secret? I can then most likely see where the drawdown happened.

Re: Drawdown [Re: jcl] #425073
06/26/13 09:20
06/26/13 09:20
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
Ok, here it goes:
// -------------------------------------------
function run()
{

StartDate = 20090520;
EndDate = 20130501;
asset("US30");
vars p10 = series(priceClose());
asset("SPX500");
vars p7 = series(priceClose());
var faktor = 0.106952;
var sigma = 0.001130;
// enter
if (*p7 > (faktor+sigma)*(*p10))
{
asset("US30");
if (NumOpenLong == 0)
enterLong(1);
asset("SPX500");
if (NumOpenShort == 0)
enterShort(1);
}

if (*p7 < (faktor-sigma)*(*p10))
{
asset("US30");
if (NumOpenShort == 0)
enterShort(1);
asset("SPX500");
if (NumOpenLong == 0)
enterLong(1);
}
// exit
if (*p7 < faktor*(*p10))
{
asset("US30");
exitLong();
asset("SPX500");
exitShort();
}

if (*p7 > faktor*(*p10))
{
asset("US30");
exitShort();
asset("SPX500");
exitLong();
}
plot("us30",faktor*(*p10),1,BLUE);
plot("spx500",*p7,0,BLACK);
plot("asdf",*p7/(faktor*(*p10)),1,RED);
plot("obere Grenze",faktor/(faktor-sigma),0,BLACK);
plot("untere Grenze",faktor/(faktor+sigma),0,BLACK);
plot("Balance",WinTotal - LossTotal,1,RED);
plot("Equity",WinTotal - LossTotal + WinValTotal - LossValTotal,0,BLACK);



PlotWidth = 800;
PlotHeight1 = 320;
}
// ---------------------------------------------------------

Re: Drawdown [Re: blaub4r] #425077
06/26/13 11:12
06/26/13 11:12
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Thanks for the script. The explanation of the phenomenon is simple, but I have to admit that the drawdown value, although correct, is here in fact misleading.

You're trading NAS and SPX at the same time. Suppose SPX wins and NAS loses. The win increases the balance, which is recorded as a balance peak. The loss then reduces the balance again at the same bar. What you're plotting in your balance curve is the net balance at the end of every bar, while the intermediate balance was much higher for a moment after closing the winning SPX trade and before closing the losing NAS trade. The high intermediate balance peak causes the large drawdown.

I'll suggest to the developers to ignore intra-bar balance peaks in the performance report. This would then display a better performance for your system.


Re: Drawdown [Re: jcl] #425083
06/26/13 13:44
06/26/13 13:44
Joined: Nov 2012
Posts: 126
B
blaub4r Offline OP
Member
blaub4r  Offline OP
Member
B

Joined: Nov 2012
Posts: 126
Thank you for the explanation!

Re: Drawdown [Re: blaub4r] #425084
06/26/13 13:59
06/26/13 13:59
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline
Serious User
DdlV  Offline
Serious User
D

Joined: Jun 2013
Posts: 1,609
jcl, from your description is there possibly something more insidious to beware of? Specifically, if the (random) trade order had happened in reverse order wouldn't the reported drawdown be accurate? And changing the performance report would therefore present an overly optimistic view, possibly leading to margin call in a real trading worst case? Would it be better to leave things as they are, or if you're going to change the report to worst-case the order of intra-bar trades?

Re: Drawdown [Re: DdlV] #425086
06/26/13 14:21
06/26/13 14:21
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
A reverse trade order could indeed have caused a more accurate drawdown, but it would still be too high in all cases where the second trade is losing. Ignoring intermediate balance peaks is the correct solution. This can not generate a too optimistic view.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1