The
exponential moving average of a
time-series of data is calculated:
emai = a * xi + (1 - a) * emai-1
Where emai-1 is the value of the exponential moving average at period i-1,
and xi is the value of the input time-series
at period i.
The weight a is typically 2/(n+1) where n is the approximate number of periods one would use in a
simple moving average.
So, if you wanted an exponential moving average which
approximated a 10-day simple moving average, a would be equal to 2/(10+1) or about 0.1818.
Therefore,
emai = 0.1818 * xi + (1 - 0.1818) * emai-1