A simple moving average needs a defined window
A moving average is a calculation over a chosen set of observations, not a forecast.
Start with three observations
A moving average is a calculation over a chosen set of observations, not a forecast. Suppose three consecutive closing prices are 10, 12 and 14. Their three-observation simple moving average is (10 + 12 + 14) / 3 = 12. All numbers here are invented price units. A different source field, such as the high or an average of high and low, produces a different series even when the period length is unchanged.
The three-close SMA first appears at observation 3 with value 12, then moves to 14. The first two values are unavailable under a full-window rule, not zero.
Open full-size diagram ↗Move the window one observation
When the next close is 16, the window becomes 12, 14 and 16. The average is now 14; the old value 10 drops out. A four-observation average of all available closes would instead be 13. Neither result is an arithmetic error. They answer different questions about the length of history being summarized.
Worked example: First window average: 12; Next window average: 14; Four-close average: 13. Invented values; units follow the row labels and article.
Open full-size diagram ↗Decide what happens before the window fills
With only two observations, a strict three-observation average is unavailable. A program might show a shorter-window mean of 11, but that is a different initialization rule. Do not substitute zero for an unavailable average. Write down the warm-up policy and make sure screenshots, exported data and any comparison calculation follow it.
Calculation checklist: Window: 3 observations; Warm-up: Unavailable until 3; Source field: Closing price. Preserve these definitions when reproducing the example.
Open full-size diagram ↗Record enough settings to reproduce the line
Keep the instrument, source field, bar interval, window length and any display offset with the chart. Three hourly closes and three daily closes summarize different spans. An unfinished bar can change before it closes. For a repeatable exercise, use closed bars and retain the three input values beside each checked output. A smooth line alone supplies no evidence that a trading rule will be profitable.
Sources and conventions
Examples are hypothetical. Worked examples state their formulas and assumptions in the article; our methodology explains the related calculators. Broker contract specifications determine actual lot, margin and execution conditions. These sources document definitions and data; a source link does not imply endorsement of SanForex or a trading service.
These materials are prepared with AI assistance and checked against worked examples and deterministic calculation tests where applicable. They are not an expert suitability assessment or investment advice.
Open trading journal tool ↗