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

[amibroker] Re: TREND DETECTORS WITH VARIABLE PERIOD (II)



PureBytes Links

Trading Reference Links

Jayson,
My Long entry is when the red line becomes green. 
The initial, fast trend detector is the black line [steady smoothing 
period=20]
The variable trend detector is the green-red line.
The first trendy bars the variable smoothing is not activated, the 
period t1 is equal to t 
and the result is a quick entry.
The variable trend detector begins to diverge after 20 consequtive 
trendy bars [this is the reason we need 
a quite smooth trend detector with minimised lag] and increases 
rapidly its smoothing period.
The result is a delayed exit, which is better for prolonged trends.
The threshold of 20 bars may change, according to your point of view, 
from the line
trendbars=20;// calibrate here the start of variable smoothing
You may use the initial, fast detector for 15 or 25 or more bars.
I think 20 is good for N100 fluctuations.
In this version, after the threshold, the smoothing period increases 
by +2 per bar. At the end of a 40-bar
trend you will actually use a 20+2*20=60 periods smoothing, which is 
also good for proper exits.
[The first version was increasing by +1 the smoothing period every 
trendy day from the beginning of the trend]
The last 3 years we saw prolonged trends in N100, I hope the same for 
the future. If Nasdaq becomes a Nikkei,
for example, then this study is nearly useless.
Thank you for this dialogue, you help a still experimental concept.
Dimitris Tsokakis
PS. See also the DELL example in Steve´s message.

--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> DT,
> I am trying to understand what you are doing here. Are you looking 
to make
> entry after the static and variable indicator diverge? does not 
this leave
> you vulnerable to the stock becoming exhausted with you late in the 
emerging
> trend? I am trying to see the possible pitfalls of using this going 
forward
> rather than looking back at the result......
> 
> TIA
> Jayson
> -----Original Message-----
> From: Dimitris Tsokakis [mailto:TSOKAKIS@x...]
> Sent: Monday, April 21, 2003 5:56 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] TREND DETECTORS WITH VARIABLE PERIOD (II)
> 
> 
> Here is an alternative.
> The first method was increasing the smoothing period for every 
trendy day,
> from the beginning till the end.
> It will do it even if the trend lasts 3 or 13 or 53 bars.
> A more realistic approach is to increase the period AFTER some 
threshhold
> bars.
> Keep the smoothing fast up to the 20th trendy bar and then increase 
the
> period to stay more in the market and enjoy
> the last [and the most interesting] part of the [prolonged] trend.
> This will help to ignore the premature exit signals, ignore the 
probable
> first pull-backs and catch the usual double peak
> formation, but, the code will examine this possible scenario AFTER 
the 20
> confirmed trend bars.
> The gif speaks better :
> The initial trend detector is the black  DEMA(StochD(40),20).
> The variable detector stays closely for the first 20 bars and then 
changes
> to a much slower mode.[green-red line]
> The obvious benefit is to ignore premature exit at the first peak 
P1,
> re-entry at R1 and goes to a final exit at P2.
> The code for IB is
> 
> t=20;x=DEMA(StochD(40),t);Plot(x,"",1,8);
> tA=50;xA=DEMA(StochD(40),tA);//Plot(xA,"",7,8);
> Cond1=Ref(x,-1)==LLV(x,3);Plot(50*Cond1,"",5,2);
> Cond2=Ref(x,-1)==HHV(x,3);Plot(50*Cond2,"",4,2);
> k1=BarsSince(Cond1);k2=BarsSince(Cond2);
> Plot((k2>k1)*10,"",5,2);Plot((k2<k1)*10,"",4,2);
> Coeff=2;
> trendbars=20;// calibrate here the start of variable smoothing
> t1=IIf(k2>k1 AND k2>trendbars,t+coeff*k1,IIf(k1>k2 AND
> k1>trendbars,t+coeff*k2,t));
> x1=DEMA(StochD(40),t1);
> Plot(x1,"",(x1>Ref(x1,-1))*5+(x1<Ref(x1,-1))*4,8);
> GraphXSpace=2;
> 
> Dimitris Tsokakis
> 
> 
>       Yahoo! Groups Sponsor
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/yMx78A/fNtFAA/i5gGAA/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/