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

[amibroker] Re: Dimitris, need your help, with your post in message 10530



PureBytes Links

Trading Reference Links


Dennis,
Here is the revised code

 
// RSI - Close troughs divergence, revised
// by D. Tsokakis, Dec 2004
// The graphic part
s1=RSI();
Plot(s1,"RSI",1,1);Title=Name();neg=0;
x = Cum(1);
per = 20;/*sensitivity calibration*/
pS = TroughBars( s1, per, 1 ) == 0;
for(I=0;I<3;I++)
{
endt0= LastValue(ValueWhen( pS, x, i+1 ));
startt0=LastValue(ValueWhen( pS, x, i+2 ));
dtS0 =endt0-startt0;
endS0 = LastValue(ValueWhen( pS, s1, i+1) );
startS0 = LastValue( ValueWhen( pS, s1, i+2  ));
endC0=LastValue(ValueWhen( pS, C, i+1) );
startC0=LastValue(ValueWhen( pS, C, i+2) );
AC0=(endC0-startC0)/dtS0;
aS0 = (endS0-startS0)/dtS0;
bS0 = endS0;
trendlineS0 = aS0 * ( x  -endt0 ) + bS0; 
ts0=IIf(x>=startt0 AND x<=endt0,trendlineS0,-1e10);
Color=IIf(As0*AC0>=0,colorBrightGreen,colorRed);
Plot(ts0,"ts"+I,Color,1);
Title=Title+"\naS"+i+"="+WriteVal(aS0)+", aC"+i+"="+WriteVal(aC0); 
neg=neg+(aS0*aC0<0);
AddColumn(aS0,"aS"+i);AddColumn(aC0,"aC"+i);
}
// The Exploration part
Filter=neg>0;// Explore for the n=1 last quotations

The RSI support will be red when a RSI-Price divergence exists.
The exploration will give all  stocks with a divergence in [at least] 
one period.
You may extend the past periods by changing the " I<3 " in the loop 
to some I<5 or I<10. I do not think it is important, only the recent 
divergences play some important role for the next stock movements.
I hope it will help, thank you for your kind comments.
Dimitris Tsokakis 
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> 
> Dennis,
> the
> http://finance.groups.yahoo.com/group/amibroker/message/10481
> has an exploration part at the end.
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "theoldchartreader" 
> <theoldchartreader@xxxx> wrote:
> > 
> > How can I change it to use as a Explore in AA.
> > It is another great formula by you.
> > 
> > I just want to say Thank you for all your work that you have 
shared 
> > with us over the years.
> > 
> > 
> > Dennis





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
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:
    http://docs.yahoo.com/info/terms/