PureBytes Links
Trading Reference Links
|
The analytic study of the optimal PERC through these years is
an application of the Inspection Points theory.In the following example, we
recheck the PERC value by the beginning of each year and keep this value for the
whole year.
// Inspection Points and the smoothed RSI
system.in=DateNum()>=900102;EVENT=in*(Year()>Ref(Year(),-1));s1=MA(RSI(),40);G=0;Plot(2,"",Cum(1)%2,1);Plot(0,"",1,styleNoLine);PlotShapes(shapeUpTriangle*EVENT,colorBlue);for(PERC=5;PERC<15;PERC++){Z=Zig(S1,PERC);RT=TroughBars(S1,PERC)==0;RT1=ValueWhen(RT,S1);RT2=(1+0.01*PERC)*RT1;Buy=in*Cross(Z,RT2);RP=PeakBars(S1,PERC)==0;RP1=ValueWhen(RP,S1);RP2=(1-0.01*PERC)*RP1;Sell=in*Cross(RP2,Z);Short=in*(Cross(60,S1)
OR
(S1<60)*Sell);Cover=Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);e1=Equity(1,0);E11=ValueWhen(EVENT,E1);G=IIf(G>E11,G,E11);}PERCPASS=0;for(PERC=5;PERC<15;PERC++){Z=Zig(S1,PERC);RT=TroughBars(S1,PERC)==0;RT1=ValueWhen(RT,S1);RT2=(1+0.01*PERC)*RT1;Buy=in*Cross(Z,RT2);RP=PeakBars(S1,PERC)==0;RP1=ValueWhen(RP,S1);RP2=(1-0.01*PERC)*RP1;Sell=in*Cross(RP2,Z);Short=in*(Cross(60,S1)
OR
(S1<60)*Sell);Cover=in*Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);e1=Equity(1,0);E11=ValueWhen(EVENT,E1);PERCpass=IIf(e11==g,PERC,0)+PERCpass;G=IIf(E11==G,0,G);}Plot(PERCpass,"PERCpass",1,8);
The range of percentages was from PERC=5% to
PERC=15%.
Some PERC selections were not lucky, they became second rate a
few bars after the selection.
The whole bunch of PERCs was positive in general, without
undesirable surprises.
Dimitris Tsokakis
----- Original Message -----
From: <A
title=tsokakis@xxxxxxxxx href="">Dimitris Tsokakis
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Monday, January 12, 2004 10:52 AM
Subject: 15 trendy years
Let us examine a smoothed RSI peaks and troughs for the lat 15
^NDX years.The
// Theoretical smoothed RSI
systems1=MA(RSI(),40);PERC=6;RT=TroughBars(S1,PERC)==0;Buy=rt;RP=PeakBars(S1,PERC)==0;Sell=rp;Short=Sell;Cover=Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
is 5-digit profitable [+47500%] from Jan1990 till end Dec2003
withbuy/sell/short/cover at +1Open, commission 0.5%, all stops
disabled.The system is not realistic, we can never buy at trough, because we
know the trough some bars later.Besides that, the equity line is interesting
: It goes with an average rate 3*B&H for the crazy decade 1990-2000 and
keeps on excellent profits during the bearish years.The slope of the equity
line is substantially increased after the bubble peak.These observations
give a hint for a closer look.We may follow<A
href="">http://groups.yahoo.com/group/amibroker/messages/17601and
buid up the
// Realistic smoothed RSI
systemPERC=6;s1=MA(RSI(),40);Z=Zig(S1,PERC);RT=TroughBars(S1,PERC)==0;RT1=ValueWhen(RT,S1);RT2=(1+0.01*PERC)*RT1;Buy=Cross(Z,RT2);RP=PeakBars(S1,PERC)==0;RP1=ValueWhen(RP,S1);RP2=(1-0.01*PERC)*RP1;Sell=Cross(RP2,Z);Short=(Cross(60,S1)
OR
(S1<60)*Sell);Cover=Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
The basic equity line property is preserved and the new,
realistic profit [+7000%] is not bad at all.PERC=6 is one of the best
choices for the first 5 years, top choice for the next 5 and definitely the best
after 2001,as we may see in IB
from for(PERC=5;PERC<=10;PERC++){s1=MA(RSI(),40);Z=Zig(S1,PERC);RT=TroughBars(S1,PERC)==0;RT1=ValueWhen(RT,S1);RT2=(1+0.01*PERC)*RT1;Buy=Cross(Z,RT2);RP=PeakBars(S1,PERC)==0;RP1=ValueWhen(RP,S1);RP2=(1-0.01*PERC)*RP1;Sell=Cross(RP2,Z);Short=(Cross(60,S1)
OR
(S1<60)*Sell);Cover=Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);Plot(Equity(),"["+WriteVal(perc,1.0)+"]",PERC,1);}
All the above equity lines have increased by +100%-500% their
27/3/2000 value.
There are many variations of the above described model, other
RSIs have much better performance.
We may also prefer the long part for the bullish years and
give more emphasis to the short part when the market was definitely
bearish.
The long term RSI gives a simple and quite expressive
description:
When r1 falls below 50, there is no doubt we are in a deep
bearish environment, long trades usually fail and short trades go with the
market. Try the simple ^NDX phase detector
<FONT
size=2>n=200;r1=LinearReg(MA(RSI(n),n/2),n/10);Plot(r1,"",1,1);
to begin with.
Dimitris Tsokakis
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
Yahoo! Groups Sponsor
ADVERTISEMENT
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Attachment:
15yearsA.gif
Attachment:
Description: "Description: GIF image"
|