MT5 offers four Moving Average calculation methods. The method determines how observations are weighted; it is different from the period, input price and horizontal shift. This reference explains the calculations rather than recommending a trading strategy.
Compare the calculation methods
The formulas use closing prices. C is the current close; N the period count; Prev the preceding average; P an exponential coefficient between 0 and 1; Σ summation; and w weight. Sum N observations. For linear weights, 1 marks the oldest observation and N the newest.
Method | Calculation and meaning |
Simple Moving Average (SMA) | SMA = ΣC / N. All N observations have equal weight. |
Exponential Moving Average (EMA) | EMA = P × C + (1 − P) × Prev. The current price is combined with the preceding average; recent prices carry more weight. |
Smoothed Moving Average (SMMA) | Start with an SMA over N observations. Subsequent SMMA = ((N − 1) × Prev + C) / N. The preceding smoothed value remains part of the calculation. |
Linear Weighted Moving Average (LWMA) | LWMA = Σ(C × w) / Σw. Weights increase from 1 to N, giving the newest observation the largest weight. |
Worked arithmetic examples
These invented prices illustrate the arithmetic. They are not trading parameters, a price forecast or a statement of the settings currently selected in your terminal.
For three consecutive closes of 10, 12 and 14, SMA = (10 + 12 + 14) / 3 = 12.
For those same closes, LWMA = (10 × 1 + 12 × 2 + 14 × 3) / (1 + 2 + 3) = 12.6667, rounded to four decimal places.
With Prev = 12, C = 14 and the illustrative coefficient P = 0.5, the next EMA is 13. This example does not establish how MT5 derives its coefficient from a selected period.
With Prev = 12, C = 14 and N = 3, the next SMMA is (2 × 12 + 14) / 3 = 12.6667, rounded to four decimal places.
Why two averages may look different
Compare the full symbol, chart timeframe, calculation method, period, input price and shift. A matching period alone does not establish an identical calculation.
A shift changes where a line is plotted. A line drawn to the right of the latest bar does not contain known future prices.
If you change the method or input data, compare like-for-like observations before treating a different value as an error. For adding, editing or removing an indicator, use the separate indicator-management guide.
An average summarizes supplied price data. Its position, slope or crossing does not guarantee the next price direction or a trading result. These examples do not place an order or change a position.
