function m = ema(x,N)
L = length(x);
m = zeros(L,1);
w = 2/(N+1);
m(1) = x(1);
for i=2:L
    m(i) = w*(x(i)-m(i-1)) + m(i-1);
end
Sable
github-repos/MATLAB/Sable-mcbench-benchmarks/mcbench-benchmarks-ba13b2f0296ef49491b95e3f984c7c41fccdb6d8/24320-algorithmic-trading-with-matlab-2009-update/ema.m
mcbench-benchmarks
github-repos/MATLAB/Sable-mcbench-benchmarks
ba13b2f0296ef49491b95e3f984c7c41fccdb6d8