# Smoothing factor of Exponential Moving Average

I'm trying to implement an Exponential Moving Average indicator, but I'm sort of stuck on the smoothing factor. What I've come up with:

$$\frac{1}{N}\sum\limits_{k=0}^N \alpha^{k} P_k$$ Where N is the window of days in consideration, k loops through the days, $\alpha$ is a smoothing factor and P is the price.

What should I use for a smoothing factor? Is there any general guidelines? And am I even near the final product?

• Do you mean $\frac{1}{\sum_{k=0}^N \alpha^{k} }\sum_{k=0}^N \alpha^{k} P_k$? – Gordon Nov 10 '15 at 16:32
• A key property of a moving average is that if all observations are equal to P (a constant) the moving average should also be equal to P. See Gordon's remark. – noob2 Nov 10 '15 at 17:26

The smoothing factor is a way to specify the memory of your estimator. This view provides a simple and natural way to tune $a$. Say you want the $k$th term in the past to weight for 1% in your estimation. It gives you $$\frac{\alpha^k}{ A} = \frac{1}{100},$$ with $A$ your normalizing factor (see @Gordon's remark).
Of course you can do better than that. For instance if you assume a model on $P(t)$ dynamics, plug it into the moving average and try to control the variance of the sliding estimator.