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

[amibroker] Re: TREND DETECTORS WITH VARIABLE PERIOD



PureBytes Links

Trading Reference Links

Thank you for all of the help.
ron
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> wrote:
> For example
> Plot((k2>k1)*10,"",5,2);
> Plot((k2<k1)*10,"",4,2);
> are zero for the last bar of ^NDX. In the title you see only the 
last 
> bar values.
> [Sorry, I did not name the plots, give them some name if you wish ]
> DT
> --- In amibroker@xxxxxxxxxxxxxxx, "rmortonmd" <ronmd@xxxx> wrote:
> > Thank you for your reply.  BTW, what do the  zero values at the 
top 
> > indicate?
> > ron
> > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> > <TSOKAKIS@xxxx> wrote:
> > > There are explanations after the // for many lines.
> > > --- In amibroker@xxxxxxxxxxxxxxx, "rmortonmd" <ronmd@xxxx> 
wrote:
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> > > > Dimitris,
> > > > As a newbie to this program, I have seen a variety of 
> > interesting 
> > > > indicators and find this one to be most intriguing.  I have 
> > several 
> > > > questions about this particular indicator: (1) there are 7 
> equal 
> > > > signs 3 of which have values different than 0 and I was 
> > wondering 
> > > > what they indicated and if it were possible to label them in 
> the 
> > > > program.  (2) There are 3 curves, a yellow one, black one 
and 
> > one 
> > > > that alternates between red and green, I assume that the 
last 
> > curve 
> > > > indicates buy and sell signals but what are the other two?  
> > Again, 
> > > > is it possible to label these (in the comments section would 
be 
> > > > fine).
> > > 
> > > Plot(x,"",1,8);// fast trend detector, BLACK
> > > Plot(xA,"",7,8);// slow trend detector, YELLOW
> > > x1=DEMA(StochD(40),t1);// the variable trend detector, GREEN-
RED
> > > The last line is GREEN for bullish trends and RED for bearish 
> > trends.
> > > Buy/sell signals need more requirements.
> > > Green/Red bars at 50 gives the start and the end of the fast 
> > uptrend.
> > > Note that colours may change in your graph according to your 
> > > preferences selection. In my colour pallete, 1 is black, 4 is 
> red, 
> > 5 
> > > is green and 7 is yellow.
> > > DT
> > > > Thank you,
> > > > ron
> > > > <TSOKAKIS@xxxx> wrote:
> > > > > Thank you for your comments.
> > > > > It is not complete yet, I have to check a lot. I hope it 
will 
> > be 
> > > > > simple at the end...
> > > > > DT
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, "goldwing01" 
> > <GOLDWING01@xxxx> 
> > > > > wrote:
> > > > > > Thank you Dimities nice piece of work with TREND 
DETECTOR. 
> I 
> > > can 
> > > > > see 
> > > > > > what you are doing thanks.
> > > > > > --- In amibroker@xxxxxxxxxxxxxxx, "Dimitris Tsokakis" 
> > > > > <TSOKAKIS@xxxx> 
> > > > > > wrote:
> > > > > > > Some uptrends are sustainable for more than 10-20 days.
> > > > > > > A fast trend detector, like DEMA(StochD(40),20) would 
buy 
> > at 
> > > > B0 
> > > > > and 
> > > > > > sell at S0.
> > > > > > > The very next days it would force the trader to follow 
> the 
> > > > > > undesirable whipsaws W1, W2 and probably loose
> > > > > > > a part of the B0/S0 profits.[see the black line]
> > > > > > > A slow trend follower like DEMA(StochD(40),50) would 
> start 
> > at 
> > > > B1
> > > > > > [missing the interesting first 7 bars] 
> > > > > > > and stop at S1[6 bars after the actual end of the 
trend]. 
> > The 
> > > > use 
> > > > > > of the slow period helps to avoid whipsaws but expose 
the 
> > > profits
> > > > > > > to a probable dramatic decrease after the actual peak. 
If 
> > the 
> > > > > start 
> > > > > > of the trend was sharp with the well known gap ups
> > > > > > > then the remaining profits would not be similar to 
this 
> > great 
> > > > > trend.
> > > > > > [see the yellow line].
> > > > > > > The technical analyst wish would be 
> > > > > > > 1. to begin ASAP, 
> > > > > > > 2. avoid the whipsaws and 
> > > > > > > 3. get out as closer to the actual peak.
> > > > > > > It is the basic T/A problem with almost any indicator 
and 
> > > here 
> > > > is 
> > > > > a 
> > > > > > solution proposal : the variable smoothing.
> > > > > > > Begin with the fast indicator and, as the trend goes 
on, 
> > > > increase 
> > > > > > smoothing factor adding +1 delay per bar.
> > > > > > > If the trend holds for 20 bars, the beginning would be 
> > per=20 
> > > > and 
> > > > > > today you would run a per=40.
> > > > > > > If the trend stops for any reason, sharply back to 
per=20 
> > to 
> > > > > begin 
> > > > > > another, bearish cycle.
> > > > > > > The result is the ENTRY/EXIT of the att. ^NDX gif
> > > > > > > Paste in your IB the
> > > > > > > 
> > > > > > > /*TREND DETECTOR WITH VARIABLE PERIOD, by D. Tsokakis, 
> > > > Apr2003*/
> > > > > > > t=20;// the initial fast period
> > > > > > > x=DEMA(StochD(40),t);
> > > > > > > Plot(x,"",1,8);// fast trend detector
> > > > > > > tA=50;// slow period
> > > > > > > xA=DEMA(StochD(40),tA);
> > > > > > > Plot(xA,"",7,8);// slow trend detector
> > > > > > > Cond1=Ref(x,-1)==LLV(x,3);
> > > > > > > Plot(50*Cond1,"",5,2);// the start of the fast uptrend
> > > > > > > Cond2=Ref(x,-1)==HHV(x,3);
> > > > > > > Plot(50*Cond2,"",4,2);// the end of the fast uptrend
> > > > > > > k1=BarsSince(Cond1);// uptrend bar counter
> > > > > > > k2=BarsSince(Cond2);// downtrend bar counter
> > > > > > > Plot((k2>k1)*10,"",5,2);
> > > > > > > Plot((k2<k1)*10,"",4,2);
> > > > > > > t1=IIf(k2>k1,t+k1,t+k2);// the variable period
> > > > > > > x1=DEMA(StochD(40),t1);// the variable trend detector
> > > > > > > Plot(x1,"",(x1>Ref(x1,-1))*5+(x1<Ref(x1,-1))*4,8);
> > > > > > > GraphXSpace=1; 
> > > > > > > 
> > > > > > > The method accepts further calibration if you replace 
t1 
> > with
> > > > > > > coeff=0.5; // delay calibration, set coeff from 0.5 to 
1.5
> > > > > > > t1=IIf(k2>k1,t+coeff*k1,t+coeff*k2);// the calibrated 
> > > variable 
> > > > > > period
> > > > > > > according to your needs.
> > > > > > > The DEMA smoothing gives very reliable results and 
> accepts 
> > > > > variable 
> > > > > > periods by design.
> > > > > > > Dimitris Tsokakis


------------------------ 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/AG3JAA/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/