I have found the ema function from the
kxforums.com. But there is
some error. Maybe because of the difference between K and Q. Can
anybody help change the function for Q?
/ the original function for exponential moving average
[code:1]\ema:{a:2%x+1;b:1-a;c:(+/x#y)%x;((x-1)#0n),c{(a*y)+b*x}\x _ y}
[/code:1]
I have changed it to the following format, but the "/" maybe should
also be replaced:
ema:{[x;y] a:2%x+1;b:1-a;c:(+/x#y)%x;((x-1)#0n),c{(a*y)+b*x}\x _ y};
Thanks.
Wind