PureBytes Links
Trading Reference Links
|
Hi Dimitris,
I forgot; what is your data source?
Did you 'purify' it?
If so, about how long did that take for the QQQs?
Would you be willing to share the purified data?
Because with (unpurified) Yahoo and the settings immediately
below, I get 239%, and with (unpurified) Esignal, 79% Return on
Account.
thanks
-john
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Dimitris
Tsokakis
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, November 25, 2003 12:58
AM
Subject: [amibroker] A STORSI application
[the real face of the optimals]
This is a variation of a STORSI system.
.
Settings
Initial Equity:
10000
Periodicity/Positions:
Daily/Long Short
Commissions:
0.25 %
Annual interest rate:
0.00%
Range:
1/9/2000 00:00:00 - 24/11/2003
Apply to:
Current Symbol
Margin requirement:
100
Futures mode:
No
Def. round lot size:
0
Def. Tick Size
0
Drawdowns based on:
Open 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:
30.00
Value:
20.00
Exit at stop?
yes
Exit at stop?
no
Trailing stop:
disabled
Value:
5.00
Exit at stop?
no
Formula SetBarsRequired(1000,1000);
function IIR2( input, f0, f1, f2 )
{
result[ 0 ] = input[ 0 ];result[ 1 ] = input[ 1 ];
for( i = 100; i < BarCount; i++ )
{
result[ i ] = f0 * input[ i ] + f1 * result[ i - 1 ] + f2 * result[ i - 2 ];
}
return result;
}
x=DEMA(RSI(10),10);t=20;
C1=100*(x-LLV(x,t))/(HHV(x,t)-LLV(x,t));
K=0.4;
RD=IIR2( C1, 0.3, 1.6, -0.9);
BLEVEL=-19;Plot(BLEVEL,"BLEVEL",1,1);
SLEVEL=49;Plot(SLEVEL,"SLEVEL",1,1);
f=DateNum()>=1000901;Buy=f*Cross(RD,BLEVEL);Sell=f*Cross(RD,SLEVEL);Short=Sell;Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Buy);Cover=ExRem(Cover,Short);
Overall performance summary
Total net profit:
31843.38
Total commissions paid:
9170.24
Return on account:
318.43 %
Open position gain/loss
772.19
Buy&Hold profit:
-6707.72
Bars (avg. days) in test:
809 (1177)
Buy&Hold % return:
-67.08%
System to Buy&Hold index:
574.73%
Annual system % return:
55.87%
Annual B&H % return:
-29.14%
System drawdown:
-1300.44
B&H drawdown:
-8043.92
Max. system drawdown:
-20359.42
B&H max. drawdown:
-8043.92
Max. system % drawdown:
-38.23%
B&H max. % drawdown:
-80.44%
Max. trade drawdown:
-17625.76
Max. trade % drawdown:
-38.23%
Trade drawdown:
-15100.36
Total number of trades:
61
Percent profitable:
70.5%
Number winning trades:
43
Number losing trades:
18
Profit of winners:
73370.58
Loss of losers:
-42399.14
Total # of bars in winners:
511
Total # of bars in losers:
315
Commissions paid in winners:
6238.05
Commissions paid in losers:
2932.19
Largest winning trade:
6265.50
Largest losing trade:
-13035.19
# of bars in largest winner:
18
# bars in largest loser:
36
Commission paid in largest winner:
102.85
Commission paid in largest loser:
304.02
Average winning trade:
1706.29
Average losing trade:
-2355.51
Avg. # of bars in winners:
11.9
Avg. # bars in losers:
17.5
Avg. commission paid in winner:
145.07
Avg. commission paid in loser:
162.90
Max consec. winners:
7
Max consec. losers:
2
Bars out of the market:
12
Interest earned:
0.00
Exposure:
98.5%
Risk adjusted ann. return:
56.71%
Ratio avg win/avg loss:
0.72
Avg. trade (win & loss):
507.73
Profit factor:
1.73
Performance for QQQ
Total net profit:
31843.38
Total commissions paid:
9170.24
Return on account:
318.43 %
Open position gain/loss
772.19
Buy&Hold profit:
-6707.72
Bars (days) in test:
809 (1177)
Buy&Hold % return:
-67.08%
System to Buy&Hold index:
574.73%
Annual system % return:
55.87%
Annual B&H % return:
-29.14%
System drawdown:
-1300.44
B&H drawdown:
-8043.92
Max. system drawdown:
-20359.42
B&H max. drawdown:
-8043.92
Max. system % drawdown:
-38.23%
B&H max. % drawdown:
-80.44%
Max. trade drawdown:
-17625.76
Max. trade % drawdown:
-38.23%
Trade drawdown:
-15100.36
Total number of trades:
61
Percent profitable:
70.5%
Number winning trades:
43
Number losing trades:
18
Profit of winners:
73370.58
Loss of losers:
-42399.14
Total # of bars in winners:
511
Total # of bars in losers:
315
Commissions paid in winners:
6238.05
Commissions paid in losers:
2932.19
Largest winning trade:
6265.50
Largest losing trade:
-13035.19
# of bars in largest winner:
18
# bars in largest loser:
36
Commission paid in largest winner:
102.85
Commission paid in largest loser:
304.02
Average winning trade:
1706.29
Average losing trade:
-2355.51
Avg. # of bars in winners:
11.9
Avg. # bars in losers:
17.5
Avg. commission paid in winner:
145.07
Avg. commission paid in loser:
162.90
Max consec. winners:
7
Max consec. losers:
2
Bars out of the market:
12
Interest earned:
0.00
Exposure:
98.5%
Risk adjusted ann. return:
56.71%
Ratio avg win/avg loss:
0.72
Avg. trade (win & loss):
507.73
Profit factor:
1.73
Trade list for QQQ
Trade
Entry date
Exit date
Net Profit
Equity value
Long
20/9/2000
22/9/2000
-662.63
9337.37
Short
22/9/2000
4/10/2000
392.48
9729.85
Long
4/10/2000
19/10/2000
-177.23
9552.63
Short
19/10/2000
21/11/2000
1366.87
10919.50
Long
21/11/2000
24/11/2000
-336.19
10583.31
Short
24/11/2000
7/12/2000
159.28
10742.59
Long
7/12/2000
8/12/2000
598.93
11341.52
Short
8/12/2000
27/12/2000
1762.16
13103.68
Long
27/12/2000
29/12/2000
343.12
13446.80
Short
29/12/2000
15/2/2001
535.81
13982.61
Long
15/2/2001
20/2/2001
-793.78
13188.84
Short
20/2/2001
5/3/2001
1883.92
15072.75
Long
5/3/2001
8/3/2001
508.94
15581.69
Short
8/3/2001
10/4/2001
3537.49
19119.19
Long
10/4/2001
11/4/2001
2042.94
21162.13
Short
11/4/2001
18/5/2001
-2856.22
18305.90
Long
18/5/2001
22/5/2001
1311.88
19617.79
Short
22/5/2001
8/6/2001
892.41
20510.20
Long
8/6/2001
11/6/2001
-864.66
19645.54
Short
11/6/2001
25/6/2001
1280.14
20925.68
Long
25/6/2001
26/6/2001
-615.23
20310.44
Short
26/6/2001
31/7/2001
232.91
20543.36
Long
31/7/2001
2/8/2001
850.21
21393.57
Short
2/8/2001
20/8/2001
2795.28
24188.85
Long
20/8/2001
22/8/2001
-374.99
23813.85
Short
22/8/2001
21/9/2001
6265.50
30079.36
Long
21/9/2001
4/10/2001
4479.69
34559.05
Short
4/10/2001
24/12/2001
-8787.56
25771.49
Long
24/12/2001
9/1/2002
1492.79
27264.28
Short
9/1/2002
28/1/2002
1738.28
29002.56
Long
28/1/2002
30/1/2002
-992.33
28010.23
Short
30/1/2002
12/2/2002
1106.02
29116.24
Long
12/2/2002
14/2/2002
525.00
29641.24
Short
14/2/2002
28/2/2002
1958.57
31599.81
Long
28/2/2002
4/3/2002
926.61
32526.42
Short
4/3/2002
5/4/2002
466.44
32992.86
Long
5/4/2002
19/4/2002
-127.04
32865.81
Short
19/4/2002
7/5/2002
5255.89
38121.71
Long
7/5/2002
9/5/2002
2790.48
40912.19
Short
9/5/2002
14/6/2002
5899.73
46811.92
Long
14/6/2002
20/6/2002
477.51
47289.43
Short
20/6/2002
1/7/2002
2018.50
49307.93
Long
1/7/2002
8/7/2002
188.59
49496.52
Short
8/7/2002
12/9/2002
5364.00
54860.52
Long
12/9/2002
16/9/2002
-1143.06
53717.46
Short
16/9/2002
27/9/2002
2810.38
56527.85
Long
27/9/2002
1/10/2002
-1952.35
54575.50
Short
1/10/2002
19/11/2002
-13035.19
41540.31
Long
19/11/2002
21/11/2002
1603.15
43143.46
Short
21/11/2002
11/12/2002
2171.89
45315.34
Long
11/12/2002
7/1/2003
1493.20
46808.54
Short
7/1/2003
21/4/2003
-1172.82
45635.72
Long
21/4/2003
23/4/2003
716.28
46352.00
Short
23/4/2003
28/5/2003
-3029.16
43322.85
Long
28/5/2003
30/5/2003
330.89
43653.74
Short
30/5/2003
2/7/2003
-1518.61
42135.12
Long
2/7/2003
7/7/2003
561.90
42697.02
Short
7/7/2003
12/8/2003
421.23
43118.25
Long
12/8/2003
18/8/2003
909.91
44028.16
Short
18/8/2003
23/9/2003
-3960.09
40068.07
Long
23/9/2003
9/10/2003
903.37
40971.44
Open Short
9/10/2003
21/11/2003
871.94
41843.38
The optimal solution we see now [BuyLevel=-19,SellLevel=49]
is a good opportunity for some comments.
It is obvious that this is not an all time optimal [or a
"robust" QQQ solution], for a very simple reason : There is no
such solution.
Let us follow the optimals of the past. The trades begin on
Sept2000. Let us inspect the performance on Dec1, 2000
and then inspect every 100 bars, select the optimal and
trade it for the rest 100 bars.
The advantage is that we shall avoid to follow a dangerous
solution for a long time.
On the other side, we should understand that on March2001 it
was impossible to "see" the nice figures of the [-19,49]
combination and, IMO, we would probably follow the leader of
this period, [-41, 28] or whatever.
This is the great disadvantage of optimization, the
temporary results are attractive and we hope they will be
repeated
in the [unknown] future.
The "realistic" profits of this way of trading were not
+318%, we could not anticipate from Sept2000 the [-19,49]
solution. They were just a +85%, as you may see
from
Settings
Initial Equity:
10000
Periodicity/Positions:
Daily/Long Short
Commissions:
0.25 %
Annual interest rate:
0.00%
Range:
1/9/2000 00:00:00 - 24/11/2003
Apply to:
Current Symbol
Margin requirement:
100
Futures mode:
No
Def. round lot size:
0
Def. Tick Size
0
Drawdowns based on:
Open 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:
30.00
Value:
20.00
Exit at stop?
yes
Exit at stop?
no
Trailing stop:
disabled
Value:
5.00
Exit at stop?
no
Formula// A Hi-pass filter
START=DateNum()==1001201 ;
EVENT=BarsSince(START)%100==0;
k0=-50;Plot(k0,"k0",Cum(1)%2,1);s0=20;
shape=33+2*(Cum(event)%10);
PlotShapes(shape*EVENT,colorBlack);
f=DateNum()>=1000901;
SetBarsRequired(1000,1000);
function IIR2( input, f0, f1, f2 )
{
result[ 0 ] = input[ 0 ];result[ 1 ] = input[ 1 ];
for( i = 100; i < BarCount; i++ )
{
result[ i ] = f0 * input[ i ] + f1 * result[ i - 1 ] + f2 * result[ i - 2 ];
}
return result;
}
x=DEMA(RSI(10),10);t=20;
C1=100*(x-LLV(x,t))/(HHV(x,t)-LLV(x,t));
RD=IIR2( C1, 0.3, 1.6, -0.9);
G=0;
for(K=k0;K<=-10;K=K+1)
{
for(s=s0;s<=70;s=s+1)
{
Buy=f*Cross(RD,k);Sell=f*Cross(RD,s);Short=Sell;Cover=Buy;
E1=Equity(1,0);
E11=ValueWhen(EVENT,E1);
G=IIf(G>E11,G,E11);
}}
Kpass=0;Spass=0;
for(K=k0;K<=-10;K=K+1)
{
for(s=s0;s<=70;s=s+1)
{
Buy=f*Cross(RD,k);Sell=f*Cross(RD,s);Short=Sell;Cover=Buy;
E1=Equity(1,0);
E11=ValueWhen(EVENT,E1);
K1=IIf(E11==G,K,0);Kpass=Kpass+K1;
S1=IIf(E11==G,S,0);Spass=Spass+S1;
G=IIf(E11==G,0,G);
}}
Buy=f*Cross(RD,Kpass);Sell=f*Cross(RD,Spass);
Short=Sell;
Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Buy);Cover=ExRem(Cover,Short);
Overall performance summary
Total net profit:
8542.42
Total commissions paid:
3886.43
Return on account:
85.42 %
Open position gain/loss
342.19
Buy&Hold profit:
-6707.72
Bars (avg. days) in test:
809 (1177)
Buy&Hold % return:
-67.08%
System to Buy&Hold index:
227.35%
Annual system % return:
21.10%
Annual B&H % return:
-29.14%
System drawdown:
-507.30
B&H drawdown:
-8043.92
Max. system drawdown:
-9022.05
B&H max. drawdown:
-8043.92
Max. system % drawdown:
-55.64%
B&H max. % drawdown:
-80.44%
Max. trade drawdown:
-7810.66
Max. trade % drawdown:
-55.64%
Trade drawdown:
-6691.55
Total number of trades:
47
Percent profitable:
68.1%
Number winning trades:
32
Number losing trades:
15
Profit of winners:
25949.92
Loss of losers:
-17793.90
Total # of bars in winners:
406
Total # of bars in losers:
352
Commissions paid in winners:
2528.77
Commissions paid in losers:
1357.66
Largest winning trade:
2507.06
Largest losing trade:
-5776.40
# of bars in largest winner:
13
# bars in largest loser:
36
Commission paid in largest winner:
71.74
Commission paid in largest loser:
134.73
Average winning trade:
810.94
Average losing trade:
-1186.26
Avg. # of bars in winners:
12.7
Avg. # bars in losers:
23.5
Avg. commission paid in winner:
79.02
Avg. commission paid in loser:
90.51
Max consec. winners:
5
Max consec. losers:
2
Bars out of the market:
66
Interest earned:
0.00
Exposure:
91.8%
Risk adjusted ann. return:
22.98%
Ratio avg win/avg loss:
0.68
Avg. trade (win & loss):
173.53
Profit factor:
1.46
Performance for QQQ
Total net profit:
8542.42
Total commissions paid:
3886.43
Return on account:
85.42 %
Open position gain/loss
342.19
Buy&Hold profit:
-6707.72
Bars (days) in test:
809 (1177)
Buy&Hold % return:
-67.08%
System to Buy&Hold index:
227.35%
Annual system % return:
21.10%
Annual B&H % return:
-29.14%
System drawdown:
-507.30
B&H drawdown:
-8043.92
Max. system drawdown:
-9022.05
B&H max. drawdown:
-8043.92
Max. system % drawdown:
-55.64%
B&H max. % drawdown:
-80.44%
Max. trade drawdown:
-7810.66
Max. trade % drawdown:
-55.64%
Trade drawdown:
-6691.55
Total number of trades:
47
Percent profitable:
68.1%
Number winning trades:
32
Number losing trades:
15
Profit of winners:
25949.92
Loss of losers:
-17793.90
Total # of bars in winners:
406
Total # of bars in losers:
352
Commissions paid in winners:
2528.77
Commissions paid in losers:
1357.66
Largest winning trade:
2507.06
Largest losing trade:
-5776.40
# of bars in largest winner:
13
# bars in largest loser:
36
Commission paid in largest winner:
71.74
Commission paid in largest loser:
134.73
Average winning trade:
810.94
Average losing trade:
-1186.26
Avg. # of bars in winners:
12.7
Avg. # bars in losers:
23.5
Avg. commission paid in winner:
79.02
Avg. commission paid in loser:
90.51
Max consec. winners:
5
Max consec. losers:
2
Bars out of the market:
66
Interest earned:
0.00
Exposure:
91.8%
Risk adjusted ann. return:
22.98%
Ratio avg win/avg loss:
0.68
Avg. trade (win & loss):
173.53
Profit factor:
1.46
Trade list for QQQ
Trade
Entry date
Exit date
Net Profit
Equity value
Long
6/12/2000
8/12/2000
20.60
10020.60
Short
8/12/2000
26/12/2000
1430.07
11450.67
Long
26/12/2000
29/12/2000
125.29
11575.96
Short
29/12/2000
14/2/2001
1100.61
12676.57
Long
14/2/2001
9/3/2001
-1918.80
10757.77
Short
9/3/2001
10/4/2001
2075.13
12832.91
Long
10/4/2001
11/4/2001
1371.23
14204.14
Short
11/4/2001
8/6/2001
-2280.98
11923.16
Long
8/6/2001
11/6/2001
-502.65
11420.51
Short
11/6/2001
25/6/2001
744.18
12164.69
Long
25/6/2001
26/6/2001
-357.65
11807.04
Short
26/6/2001
20/8/2001
1242.83
13049.87
Long
20/8/2001
21/8/2001
85.86
13135.73
Short
21/8/2001
24/12/2001
-494.34
12641.39
Long
24/12/2001
28/12/2001
175.54
12816.93
Short
28/12/2001
28/1/2002
298.73
13115.66
Long
28/1/2002
29/1/2002
-72.08
13043.58
Short
29/1/2002
12/2/2002
874.96
13918.54
Long
12/2/2002
13/2/2002
86.96
14005.50
Short
13/2/2002
1/3/2002
910.38
14915.88
Long
1/3/2002
4/3/2002
599.23
15515.11
Short
4/3/2002
5/4/2002
222.49
15737.60
Long
5/4/2002
19/4/2002
-60.60
15677.00
Short
19/4/2002
7/5/2002
2507.06
18184.06
Long
7/5/2002
9/5/2002
1331.06
19515.12
Short
9/5/2002
17/6/2002
2109.48
21624.60
Long
17/6/2002
20/6/2002
-668.83
20955.77
Short
20/6/2002
1/7/2002
894.48
21850.25
Long
1/7/2002
8/7/2002
83.57
21933.82
Short
8/7/2002
12/9/2002
2377.00
24310.82
Long
12/9/2002
16/9/2002
-506.53
23804.28
Short
16/9/2002
27/9/2002
1245.39
25049.67
Long
27/9/2002
1/10/2002
-865.16
24184.51
Short
1/10/2002
19/11/2002
-5776.40
18408.12
Long
19/11/2002
21/11/2002
710.42
19118.53
Short
21/11/2002
11/12/2002
962.45
20080.98
Long
11/12/2002
7/1/2003
661.69
20742.67
Short
7/1/2003
21/4/2003
-519.72
20222.95
Long
21/4/2003
23/4/2003
317.41
20540.36
Short
23/4/2003
28/5/2003
-1342.34
19198.03
Long
28/5/2003
30/5/2003
146.63
19344.66
Short
30/5/2003
2/7/2003
-672.96
18671.70
Long
2/7/2003
7/7/2003
249.00
18920.70
Short
7/7/2003
12/8/2003
186.66
19107.36
Long
12/8/2003
18/8/2003
403.21
19510.58
Short
18/8/2003
23/9/2003
-1754.87
17755.71
Long
23/9/2003
9/10/2003
400.32
18156.03
Open Short
9/10/2003
21/11/2003
386.39
18542.42
In the att. gif, last pane, you may see the competition of
the local optimals.
We would be so happy in April2002 with this
optimization bubble.
Dimitris TsokakisSend
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|