PureBytes Links
Trading Reference Links
|
... more or less...
j '-)
---8<-----------------------
/* Exponential Moving Average v2.0 */
/* EMA periodicity adapts to low bar count */
/* josesilva22@xxxxxxxxx */
Title = "EMA/breakout signals";
pds = Param("EMA periods",21,2,252,1);
x = Param("Op=1 Hi=2 Lo=3 Cl=4 Vol=5",4,1,5,1);
shift = 1+Param("EMA vertical shift %",0,-100,100,0.01)/100;
xx = Param("EMA=1, Signals=2",1,1,2,1);
p = IIf(x==1,O,IIf(x==2,H,IIf(x==3,L,IIf(x==5,V,C))));
prds = IIf(Cum(p!=-101)<pds,Cum(p!=-101),pds);
EMAadapt = AMA(p,2/(prds+1))*shift;
signals = Cross(p,EMAadapt)+Cross(EMAadapt,p)*-1;
Plot(IIf(xx==1,C,0),"",colorBlue,styleLine);
Plot(IIf(xx==1,EMAadapt,signals),"EMA",colorRed,styleLine);
---8<-----------------------
------------------------ 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/
|