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

Re: [amibroker] Re: EMA/breakout signals composite indicator



PureBytes Links

Trading Reference Links

Hello,

I have fixed the formula for you. There were several errors.
For example you were using the same values in x = IIF line
and you were usign IIF function as a control flow statement.
To learn more about difference between IIF and if-else
please read Tutorial: understanding how AFL works and
check IIF help page at http://www.amibroker.com/guide/afl_view.php?name=IIF


/* Exponential Moving Average v1.0 */

/* EMA periodicity adapts to low bar count */

/* josesilva22@xxxxxxxxx */

Title = "EMA/breakout signals"; 

pds = Param("EMA periods",21,1,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;

display = Param("EMA=1, Signals=2",1,1,2,1);

x = IIf(x==1,O,IIf(x==2,H,IIf(x==3,L,IIf(x==4,C,V))));

prds = pds;

EMA1 = AMA(x,2/(prds+1))*shift;

signals = Cross(x,EMA1)+Cross(EMA1,x)*-1;

if(display==2)

{

Plot(0,"",colorBlue,styleLine);

Plot(signals,"EMA signals",colorRed,styleLine);

}

else

{

Plot(Close,"",1,128);

Plot(EMA1,"EMA",colorRed,styleLine);

}

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Jose" <josesilva22@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Friday, June 13, 2003 9:59 PM
Subject: [amibroker] Re: EMA/breakout signals composite indicator


> > > x = IIf(x==1,O,IIf(x==1,H,IIf(x==1,L,IIf(x==1,V,C))));
> > 
> > In this line you wonder all the time if x==1.
> > Perhaps you want to do something else...
> 
> Oopsey...typo.   Thank you.
> 
> x = IIf(x==1,O,IIf(x==2,H,IIf(x==3,L,IIf(x==5,V,C))));
> 
> 
> Any idea why the display Parameter doesn't work for me?
> 
> j '-)
> 
> 
> 
> 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/