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

[amibroker] Re: writeif in functions ?



PureBytes Links

Trading Reference Links




The factor f=2/(n+1) is less than 1 when n>2.
Any exponential f^k will be also less than 1.
This property gives an opportunity to modify the 
EMA.
 
SetBarsRequired(10000<FONT 
size=2>,10000); 
n=20;
Output1[0]=C[<FONT 
size=2>0];
f = 2/(n+<FONT 
size=2>1);
k=Param(<FONT 
size=2>"k",1<FONT 
size=2>,0.1,<FONT 
size=2>3,0.1<FONT 
size=2>);
for( i = 1; i 
< BarCount; i++ )
{
output1[ i ] = f^k * C[ i ] + (1 - 
f^k) * output1[ i - 1 ];
}
Plot(EMA<FONT 
size=2>(C,n),"ema"<FONT 
size=2>,colorBrightGreen,1<FONT 
size=2>);
Plot(Output1,<FONT 
size=2>"EXPema",colorWhite,8<FONT 
size=2>);
Plot(C,"C"<FONT 
size=2>,1,<FONT 
size=2>8);
 
For k=1 the EXPema becomes the regular EMA.
Dimitris Tsokakis


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








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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 the Yahoo! Terms of Service.