Glossary
Exponential moving average
A moving average that weights recent prices more and lets older ones fade, with smoothing factor alpha = 2 / (n + 1).
The EMA is updated as EMA_new = alpha x P + (1 - alpha) x EMA_old, with alpha = 2 / (n + 1). The weights never reach zero, so old prices keep a small influence.
On a steady trend it lags by the same (n - 1) / 2 periods as a simple average of length n, but it reacts faster to a sudden move. The first value needs a seed.
Example: for n = 10, alpha is 0.1818. If the previous EMA is 100 and the price is 110, the new EMA is 0.1818 x 110 + 0.8182 x 100, or 101.82.