PureBytes Links
Trading Reference Links
|
Willem
Weak or slow systems [less than 5trades/year]] sometimes need an
Equity conditional exit rule which usually improves the final
performance.
In the following code I placed a 3-bar filter [to avoid the small
drawdown caused by the 0.5% commission] and give an additional Exit
rule, whenever the e1 falls below e2.
You will miss the enthusiastic pull backs, but you will surely avoid
the undesirable huge losses.
// Equity conditional exit
Buy=...;// your buy rule
Sell=...;// your sell rule
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
t0=10;// Optimize("t0",5,5,10,5);
t2=10;// Optimize("t2",5,5,10,5);
y=Optimize("Y",7,0,10,1);
e0=Equity();
// smoothed Equity lines
R0=DEMA(e0,T0);
R1=DEMA(R0,T0);
R2=DEMA(R1,T0);
R3=DEMA(R2,T0);
R4=DEMA(R3,T0);
R5=DEMA(R4,T0);
R6=DEMA(R5,T0);
R7=DEMA(R6,T0);
R8=DEMA(R7,T0);
R9=DEMA(R8,T0);
R10=DEMA(R9,T0);
// Select smoothing factor
e1=IIf(Y==0,R0,
IIf(Y==1,R1,
IIf(Y==2,R2,
IIf(Y==3,R3,
IIf(Y==4,R4,
IIf(Y==5,R5,
IIf(Y==6,R6,
IIf(Y==7,R7,
IIf(Y==8,R8,
IIf(Y==9,R9,R10))))))))));
e2=DEMA(e1,t2);
// Conditional Exit
exitLong=BarsSince(Buy)>3 AND e1<e2;
Sell=Sell OR exitLong;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Willem Jan A. Struyck"
<w.j.a.struyck@xxxx> wrote:
> Dimitris,
>
> For evaluation purposes I took the basket of my selection of
favorite Robeco
> funds and evaluated them against the system I currently use.
> Backtesting over 1 year. Optimized till I found the best set of
parameters.
> By lack of another name I named your formula's platform 1, 2 and 3.
> 2 and 3 clearly give better results ocmpared to 1 although the
difference
> between 2 and 3 is not that great.
> Generally I found for my basket Y=3 or 2 giving the best result.
>
> To study the outcome I have attached the respective reports.
>
> Willem jan
>
>
> Message: 14
> Date: Thu, 10 Jul 2003 19:07:30 -0000
> From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> Subject: Re: C vs (H+L)/2 [part two]
>
> Willem,
> sorry for the delay, the day was not easy.
> We may apply DEMA smoothing many times with two main results : The
> amplitude increment and the phase transition to the right.
> The cascade phase transition can immitate the impulse of ^NDX
changes
> to other markets.
> Y=5 is fine for the long term NDX study, Y=8 for DAX, Y=10 for FCHI
> etc.
> For indicator builder or AA window use the example
>
> N="^NDX";
> O=Foreign(N,"O");H=Foreign(N,"H");L=Foreign(N,"L");C=Foreign(N,"C");
> T1=5;R0=RSIA(C,T1)-RSIA((H+L),T1);
>
> t0=50;R0=DEMA(R0,T0);
>
> // Apply cascade smoothing
> R1=DEMA(R0,T0);
> R2=DEMA(R1,T0);Plot(R2,"",1,8);
> R3=DEMA(R2,T0);
> R4=DEMA(R3,T0);Plot(R4,"",4,8);
> R5=DEMA(R4,T0);
> R6=DEMA(R5,T0);Plot(R6,"",7,8);
> R7=DEMA(R6,T0);
> R8=DEMA(R7,T0);Plot(R8,"",5,8);
> R9=DEMA(R8,T0);
> R10=DEMA(R9,T0);Plot(R10,"",2,8);
> // Select smoothing level
> Y=Optimize("Y",10,0,10,1);
> R=IIf(Y==0,R0,
> IIf(Y==1,R1,
> IIf(Y==2,R2,
> IIf(Y==3,R3,
> IIf(Y==4,R4,
> IIf(Y==5,R5,
> IIf(Y==6,R6,
> IIf(Y==7,R7,
> IIf(Y==8,R8,
> IIf(Y==9,R9,R10))))))))));
> // Select trading bars
> X=Optimize("X",28,5,30,1);
> Buy=Cross(0,R);Buy=ExRemSpan(Buy,X);Sell=Ref(Buy,-X);
> Plot(R,"",9,8);
>
> to investigate the rhytm of ^NDX affection to other markets.
> Dimitris Tsokakis
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy 1, Get 1 FREE
Control Cravings & Hunger EZ! Fast Acting Natural Oral Spray - $19.97
http://www.challengerone.com/t/l.asp?cid=2866&lp=ezappetite3.html
http://us.click.yahoo.com/rJIe0D/99VGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->
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 http://docs.yahoo.com/info/terms/
|