PureBytes Links
Trading Reference Links
|
na = Param("number of bars", 20,1,1000,1);
mt = Param("if 1 then 2n else number",1,100,1); //Test was 2m, code was 2n. I changed text.
lena = IIf(mt == 1,2 * na,mt);
function newma(t,n,lent)
{
for ( I = 1; I < BarCount; I++ )
{
if (I<n+1)
{
MM[I] = t[I];
}
else
{
MM[I] = ( n*( abs(t[I]-MM[I-1]) / MM[I-1] - abs(MM[I-1]-MM[I-n]) /MM[I-n]) / (lent - n) ) * (t[I]-MM[I-1]) + MM[I-1];
}
}
return MM;
}
Plot (newma(C,na,Lena),"myema",colorRed,1);
Plot ( Close, "Price", colorBlack, styleCandle );
When I click on the chart or zoom in or out it changes it's value.
Thanks,
Erkan
Yahoo! for Good
Click here to donate to the Hurricane Katrina relief effort.
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
YAHOO! GROUPS LINKS
|