[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tharp's ATR-based PositionSizing



PureBytes Links

Trading Reference Links

further to an earlier post by CS i added the van Tharp's
ATR-based position sizing code to the StoRSI-BBP system we have
been using on the list in several examples. I attach the backtest
results for the N100 stocks. Typical results look like this:

No Stops&PosSizing Tharp PositionSizing Ratio
NoTharp/Tharp
Range %Profit Max%DD %Profit Max%DD %Profit Max%DD
QQQ 7/20/99-10/1/02 128.00% 34.00% 8.95% 2.00% 14.30 17.00
N100 1250 bars 217.00% 85.00% 7.93% 6.04% 27.36 14.07


If, like it has been mentioned on this list several times, the
application of van Tharp's techniques are a matter of ruin or
no-ruin then we should have at least one single person on this
list of about 1000 who can to come forward with a practical
example that works. My appreciation of this topic swings from
great admiration one day to total dismay the next...

Can somebody show where I went wrong and give a correct example?

Best regards,
Herman.




------=_NextPart_001_0009_01C27A84.84C57500
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" http-equiv=3DContent-Type=
>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D520242114-23102002>further t=
o an=20
earlier post by CS i&nbsp;added the van Tharp's ATR-based position sizing c=
ode=20
to the StoRSI-BBP system we have been using on the list&nbsp;in several=20
examples. I attach the backtest results for the N100 stocks. Typical result=
s=20
look like this:</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV><FONT size=3D2><SPAN=20
class=3D520242114-23102002>
<TABLE border=3D0 cellPadding=3D0 cellSpacing=3D0=20
style=3D"BORDER-COLLAPSE: collapse; WIDTH: 402pt" width=3D533 x:str>
<COLGROUP>
<COL style=3D"WIDTH: 28pt; mso-width-source: userset; mso-width-alt: 1353=
"=20
width=3D37>
<COL style=3D"WIDTH: 74pt; mso-width-source: userset; mso-width-alt: 3584=
"=20
width=3D98>
<COL style=3D"WIDTH: 44pt; mso-width-source: userset; mso-width-alt: 2121=
"=20
width=3D58>
<COL style=3D"WIDTH: 47pt; mso-width-source: userset; mso-width-alt: 2267=
"=20
width=3D62>
<COL style=3D"WIDTH: 50pt; mso-width-source: userset; mso-width-alt: 2450=
"=20
width=3D67>
<COL style=3D"WIDTH: 54pt; mso-width-source: userset; mso-width-alt: 2633=
"=20
width=3D72>
<COL style=3D"WIDTH: 46pt; mso-width-source: userset; mso-width-alt: 2230=
"=20
width=3D61>
<COL style=3D"WIDTH: 59pt; mso-width-source: userset; mso-width-alt: 2852=
"=20
width=3D78>
<TBODY>
<TR height=3D17 style=3D"HEIGHT: 12.75pt">
<TD class=3Dxl22 height=3D17 style=3D"HEIGHT: 12.75pt; WIDTH: 28pt"=20
width=3D37><FONT face=3DArial>&nbsp;</FONT></TD>
<TD class=3Dxl24 style=3D"BORDER-LEFT: medium none; WIDTH: 74pt" width=
=3D98>
<DIV align=3Dcenter><FONT face=3DArial size=3D2>&nbsp;</FONT></DIV></=
TD>
<TD class=3Dxl26 colSpan=3D2 style=3D"BORDER-RIGHT: black 1pt solid; WI=
DTH: 91pt"=20
width=3D120>
<DIV align=3Dcenter><FONT face=3DArial size=3D2>No&nbsp;<SPAN=20
class=3D520242114-23102002>Stops</SPAN><SPAN=20
class=3D520242114-23102002>&amp;</SPAN>PosSizing</FONT></DIV></TD>
<TD class=3Dxl26 colSpan=3D2=20
style=3D"BORDER-LEFT: medium none; BORDER-RIGHT: black 1pt solid; WIDTH=
: 104pt"=20
width=3D139>
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Tharp=20
PositionSizing</FONT></DIV></TD>
<TD class=3Dxl26 colSpan=3D2=20
style=3D"BORDER-LEFT: medium none; BORDER-RIGHT: black 1pt solid; WIDTH=
: 105pt"=20
width=3D139>
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Ratio=20
NoTharp/Tharp</FONT></DIV></TD></TR>
<TR height=3D17 style=3D"HEIGHT: 12.75pt">
<TD class=3Dxl22 height=3D17 style=3D"BORDER-TOP: medium none; HEIGHT: =
12.75pt">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>&nbsp;</FONT></DIV></=
TD>
<TD class=3Dxl25 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Range</FONT></DIV></T=
D>
<TD class=3Dxl28 style=3D"BORDER-TOP: medium none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>%Profit</FONT></DIV><=
/TD>
<TD class=3Dxl29 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Max%DD</FONT></DIV></=
TD>
<TD class=3Dxl28 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>%Profit</FONT></DIV><=
/TD>
<TD class=3Dxl29 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Max%DD</FONT></DIV></=
TD>
<TD class=3Dxl28 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>%Profit</FONT></DIV><=
/TD>
<TD class=3Dxl29 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>Max%DD</FONT></DIV></=
TD></TR>
<TR height=3D17 style=3D"HEIGHT: 12.75pt">
<TD class=3Dxl23 height=3D17 style=3D"BORDER-TOP: medium none; HEIGHT: =
12.75pt">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>QQQ</FONT></DIV></TD>
<TD class=3Dxl24 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>7/20/99-10/1/02</FONT=
></DIV></TD>
<TD class=3Dxl30 style=3D"BORDER-TOP: medium none" x:num=3D"1.28">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>128.00%</FONT></DIV><=
/TD>
<TD class=3Dxl31 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"00.34">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>34.00%</FONT></DIV></=
TD>
<TD class=3Dxl30 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"8.9499999999999996E-2">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>8.95%</FONT></DIV></T=
D>
<TD class=3Dxl31 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"00.02">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>2.00%</FONT></DIV></T=
D>
<TD class=3Dxl34 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"14.301675977653632" x:fmla=3D"=3DC3/E3">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>14.30</FONT></DIV></T=
D>
<TD class=3Dxl35 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num x:fmla=3D"=3DD3/F3">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>17.00</FONT></DIV></T=
D></TR>
<TR height=3D18 style=3D"HEIGHT: 13.5pt">
<TD class=3Dxl23 height=3D18 style=3D"BORDER-TOP: medium none; HEIGHT: =
13.5pt">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>N100</FONT></DIV></TD=
>
<TD class=3Dxl24 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>1250 bars</FONT></DIV=
></TD>
<TD class=3Dxl32 style=3D"BORDER-TOP: medium none" x:num=3D"2.17">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>217.00%</FONT></DIV><=
/TD>
<TD class=3Dxl33 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"00.85">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>85.00%</FONT></DIV></=
TD>
<TD class=3Dxl32 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"7.9299999999999995E-2">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>7.93%</FONT></DIV></T=
D>
<TD class=3Dxl33 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"6.0400000000000002E-2">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>6.04%</FONT></DIV></T=
D>
<TD class=3Dxl36 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"27.364438839848678" x:fmla=3D"=3DC4/E4">
<DIV align=3Dcenter><FONT face=3DArial size=3D2>27.36</FONT></DIV></T=
D>
<TD class=3Dxl37 style=3D"BORDER-LEFT: medium none; BORDER-TOP: medium =
none"=20
x:num=3D"14.072847682119205" x:fmla=3D"=3DD4/F4">
<DIV align=3Dcenter><FONT face=3DArial=20
size=3D2>14.07</FONT></DIV></TD></TR></TBODY></TABLE>
<DIV></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D520242114-23102002>If, like =
it has been=20
mentioned on this list several times, the application of van Tharp's=20
techniques&nbsp;are a matter of ruin or no-ruin then we should have at leas=
t one=20
single person on this list of about 1000 who&nbsp;can to come forward with =
a=20
practical example that works. My appreciation of this topic swings from gre=
at=20
admiration one day to total dismay the next...</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D520242114-23102002>Can someb=
ody show=20
where&nbsp;I went wrong and give a correct example?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D520242114-23102002>Best=20
regards,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002>Herman.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D520242114-23102002></SPAN></=
FONT><FONT=20
face=3DArial size=3D2><SPAN class=3D520242114-23102002></SPAN></FONT>&nbsp;=
</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D520242114-23102002></SPAN></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_001_0009_01C27A84.84C57500--

Title: AmiBroker System Test Report






Settings

 

Initial Equity:
100000

Periodicity/Positions:
Daily/Long 

Commissions:
0.00 %

Annual interest rate:
0.00%

Range:
1249 bars

Apply to:
Filter

Include Filter
 

Exclude Filter
 

Market
-

Market
-

Group
-

Group
-

Sector
-

Sector
-

Industry
-

Industry
-

Watch list
N100

Watch list
-

Index
-

Index
-

Favourite
-

Favourite
-

Margin requirement:
100

Futures mode:
No

Def. round lot size:
0

Def. Tick Size
0

Drawdowns based on:
High/Low prices

 
 

Long trades

Buy price:
Open

Sell price:
Open

Buy delay:
1

Sell delay:
1

Short trades

Short price:
Open

Cover price:
Open

Short delay:
1

Cover delay:
1

Stops

Maximum loss:
disabled

Profit target:
disabled

Value:
5.00

Value:
30.00

Exit at stop?
yes

Exit at stop?
yes

 

Trailing stop:
disabled

 
 

Value:
10.00

 
 

Exit at stop?
yes

 
 




Formula// Composite Bull/Bear Pressure DLLVersion 1.0.. By Anthony Faragasso 
// Credit to Peter Gialames for formula conversion into plugin Dll. 
// StoRSI by Steve Karnish 
x=afBBTicker();//This Calls the plugin 
AddToComposite(BullishPressure,"~NDX100bullishpressure","x"); 
AddToComposite(BearPressure,"~NDX100bearPressure","x"); 
bull=Foreign("~NDX100bullishPressure","C"); 
bear=Foreign("~NDX100bearPressure","C"); 
Pd = 14; //Optimize("PD",10,2,30,2); 
SmBULL = hbT3A(100*bull/(bull+bear),Pd,0.5); 
SmBEAR = hbT3A(100*bear/(bull+bear),Pd,0.5); 
EnL = SmBull > 50; 
EnS = SmBear > 50; 
StochRsi=EMA((RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8)),3)*100; 
Buy=Cross(17,StochRsi) AND EnL; 
Sell=Cross(StochRsi,83); 
Short=Cross(StochRsi,83) AND EnS; 
Cover=Cross(17,StochRsi); 
E = Equity(1); 
Plot(E,"E", 1,1); 
 
Sell = 0; // selling only by stop 
TrailStopAmount = 2 * ATR( 20 ); 
Capital = 100000;  
// IMPORTANT: Set it also in the Settings: Initial Equity 
Risk = 0.01*Capital; 
PositionSize = (Risk/TrailStopAmount)*BuyPrice; 
ApplyStop( 2, 2, TrailStopAmount, 1 ); 
E=Equity(1); 
Plot(E,"ATREquity",4,1);  
/* 
                   




Overall performance summary

 

Total net profit:
776945.50
 
Total commissions paid:
0.00

Return on account:
7.93 % 
 
Open position gain/loss
1294.87

Buy&Hold profit:
7018016.15
 
Bars (avg. days) in test:
119552 (1772)

Buy&Hold % return:
71.61%
 
System to Buy&Hold index:
-88.93%

 

Annual system % return:
1.58%
 
Annual B&H % return:
11.77%

 

System drawdown:
-5481.38
 
B&H drawdown:
-94442.11

Max. system drawdown:
-6706.81
 
B&H max. drawdown:
-10399030.30

Max. system % drawdown:
-6.04%
 
B&H max. % drawdown:
-99.63%

Max. trade drawdown:
-5145.48
 
 
 

Max. trade % drawdown:
-3.37%
 
 
 

Trade drawdown:
-2827.63
 
 
 

 

Total number of trades:
2380
 
Percent profitable:
53.3%

Number winning trades:
1268
 
Number losing trades:
1112

Profit of winners:
1235070.01
 
Loss of losers:
-459419.38

Total # of bars in winners:
17268
 
Total # of bars in losers:
7793

Commissions paid in winners:
0.00
 
Commissions paid in losers:
0.00

 

Largest winning trade:
5882.23
 
Largest losing trade:
-2637.83

# of bars in largest winner:
42
 
# bars in largest loser:
2

Commission paid in largest winner:
0.00
 
Commission paid in largest loser:
0.00

 

Average winning trade:
974.03
 
Average losing trade:
-413.15

Avg. # of bars in winners:
13.6
 
Avg. # bars in losers:
7.0

Avg. commission paid in winner:
0.00
 
Avg. commission paid in loser:
0.00

Max consec. winners:
11
 
Max consec. losers:
8

 

Bars out of the market:
94387
 
Interest earned:
0.00

 

Exposure:
21.0%
 
Risk adjusted ann. return:
7.52%

Ratio avg win/avg loss:
2.36
 
Avg. trade (win & loss):
325.90

Profit factor:
2.69