Break down Simple Moving Average formula

Solution 1:

You are looking at the simple moving average with window length of $n$. This formula is relevant to variable that forms a sequence. Meaning the quantity that you are studying should have some sense of order in it. For example stock prices, temperature during the day, from such series.

So simply speaking you have a sequence $(p_k)$ where $k$ is a natural number $1,2,3,...$

SMA of window $n$ is defined for the sequence $(p_k)$ for all values of $k\ge n$. Now basically you take sum of $n-1$ past values and the current value and divide by $n$ to get the moving average.

Tell me if any of this is not clear.