We may be talking apples and oranges here. I am
not trying to "move 5 averages". I'm not even sure what that means.
I am using the definition of a "simple moving average" as defined in several sources. Here are just two:
A moving average (MA) is a technical analysis indicator that helps level price action by filtering out the noise from random price fluctuations.
www.investopedia.com
en.wikipedia.org
In my solution, a simple moving average of length
N, is the simple average of the last
N values. But if there are less than
N values, then it's the average of as many values as there are. For the first
N-1,values the moving average is the simple average of a many values as there are. As you can see in my examples, the moving average of the first value is just that value. The moving average of the first 2 values is the sum of those values divided by 2. And so on.
Now there are other types of moving averages, such as weighted and exponential. These take into account more values and they have different uses.