I'm trying to create a 7 Day Moving average column for my sales. I am having trouble in comprehending the notion of moving averages as I'm not sure which date should the Moving Average value be associated to.
Data
+--------+-------+----+
| date | sales | MA |
+--------+-------+----+
| 1-Jan | 5 | |
| 2-Jan | 10 | |
| 3-Jan | 15 | |
| 4-Jan | 10 | |
| 5-Jan | 20 | |
| 6-Jan | 40 | |
| 7-Jan | 25 | |
| 8-Jan | 30 | |
| 9-Jan | 40 | |
| 10-Jan | 20 | |
| 11-Jan | 50 | |
| 12-Jan | 10 | |
+--------+-------+----+
Question:
If i take the MA of say January 8th which is the sales average between Jan 2nd and Jan 8th (inclusively), I'd compute 21.42. Should this value be associated with row Jan 2nd or Jan 8th ? If both answers are accepted, what are the different notions of using either one?
Associate it with January 8th. Moving averages in cases like this always correspond to the previous 7 days, meaning the latest day in the series is the day to which the average is associated.
Take moving averages in stock prices for an example. If the 7-day simple moving average of stock ABC on June 16, 2020, is \$50, that means that the average price of ABC's stock over the previous 7 trading days is \$50. If we associate moving averages with future dates then we wouldn't be able to calculate the June 16 moving average for 7 more trading days, making it unusable.