PureBytes Links
Trading Reference Links
|
You will find this already in the archives, and maybe in the AB AFL library
Got this from previous posts Message 26372 - amibroker YahooGroup
period=10;
smooth23=(C+(2*Ref(C,-1))+(2*Ref(C,-2))+Ref(C,-3))/6;
change=ROC(smooth23,1);
Cu23=Sum(IIf(Change>0,Change,0),period);
Cd23=Sum(IIf(Change<0,abs(Change),0),period);
ehlers=Cu23/(Cu23+Cd23);
Plot(ehlers,"Ehlers smoothed RSI",11,4);
Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia
-----Original Message-----
From: Keith Newhouse [mailto:knewhous@xxxxxxxxxxxxxxx]
Sent: Saturday, 14 June 2003 10:48 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Code help, please
Here is the Metastock code for Ehlers Smoothed RSI and below is my
attempt in AFL. The AFL code is obviously incorrect as it produces
an entirely different result. Could some one correct it for me,
please.
Keith
Metastock.
len:=Input("No of bars",1,100,14);
smooth23:=(C+(2*Ref(C,-1))+(2*Ref(C,-2))+Ref(C,-3))/6;
change:=ROC(smooth23,1,$); cu23:=Sum(If(change>0,change,0),len);
cd23:=Sum(If(change<0,Abs(change),0),len);
cu23/(cu23+cd23)
AFL
Len=10;
smooth23=(C+(2*Ref(C,-1))+(2*Ref(C,-2))+Ref(C,-3))/6;
Change=ROC(smooth23,1);
cu23=Sum(IIf(Change>0,Change,0),Len);
cd23=Sum(IIf(Change<0,b=Change,0),Len);
SRSI=Cu23/(Cu23+Cd23);
Plot(SRSI,"SRSI",colorRed,styleLine);
------------------------ Yahoo! Groups Sponsor ---------------------~--> Get
A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/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/
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/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/
|