Indicators
EMA and SMA: trend filters, crossovers, and lag
Compare exponential and simple moving averages, interpret crossovers, and account for lag and whipsaws when building trading signal rules.
By atradeaday · Published
A moving average summarizes a rolling price history. A simple moving average gives equal weight to each observation in its window. An exponential moving average gives more weight to recent observations. Both transform past data; neither sees the next price.
What the calculation changes
A five-close SMA for 100, 102, 101, 103, and 104 is 102. When the next close arrives, the oldest close leaves the window. A conventional EMA updates the previous value using a smoothing factor of 2 / (period + 1). Seeding choices and warm-up history can cause differences between implementations.
For the same nominal period, an EMA reacts more quickly to a recent price change, but that responsiveness can also produce more direction changes. There is no universally best period. A 21-bar calculation on a five-minute chart describes a different history from a 21-bar calculation on a daily chart.
Turn a crossover into a rule
A bullish crossover means the chosen fast average has moved above the slow one. Specify whether it must hold at a completed candle close. If the signal requires that close, an honest historical simulation uses a subsequent executable price rather than an earlier price inside the signal candle.
Consider a hypothetical fast EMA crossing above a slow EMA while both are flat and price is still inside a narrow range. That event is materially different from a crossover following a higher low with both averages rising. Test a context filter rather than assuming the cross is self-sufficient.
Lag is part of the tool
Smoothing reduces some short-term variation by delaying the response. Waiting for confirmation can mean entering after much of a move has already occurred. In sideways markets, repeated crossings may create small losses and repeated transaction costs.
Do not solve every whipsaw by increasing the period until the historical chart looks clean. That process can fit yesterday's noise. Compare a small set of predeclared settings across unseen periods and include costs.
A review workflow
Record the instrument, timeframe, period, price input, and warm-up rule. Compare the average's slope with the current market structure. Then define the actual entry, invalidation, and sizing rule separately from the indicator.
For indicator definitions and related tools, see Fidelity's technical indicator guide. Continue with MACD for a momentum measure built from moving averages.