The *n*
*day simple moving average* for day *d*
is computed by:

If we have ten measurements, *M*_{1}
through *M*_{10},
and we wish to
compute a four day moving average, the moving averages for successive
days are:

We can't compute a four day moving average until we have four days
worth of data. That's why the first moving average in this example
is *A*_{4}.

By John Walker