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

[amibroker] Code help, please



PureBytes Links

Trading Reference Links

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/