Moving averages: EMA vs SMA, and how to use them
A moving average is the plainest indicator there is: the average close over the last N bars, redrawn as each bar closes. Nearly every strategy uses one somewhere, usually to say which way the market has been leaning. This guide is the two common kinds, what the length means, and the two ways to write one into a condition.
Simple and exponential
A simple moving average (SMA) is the arithmetic mean of the last N closes, every bar counting equally. An exponential moving average (EMA) weights the newest bars most heavily, so it turns sooner than an SMA of the same length and sits closer to price. The cost of turning sooner is turning more often: an EMA reverses on moves an SMA would have smoothed over.
Neither is better. An SMA describes where price has been on average; an EMA describes where it has been recently. SixOne8 offers both, and a Hull moving average, which is built to cut the lag further still.
What a length means
The length is a count of bars of the timeframe the condition reads, so the same number means a different span of time on each chart. A 50-period average on the 1-hour chart covers about two trading days; on the daily chart it covers ten weeks. The defaults in SixOne8 are 20 for a single average and 20 and 50 for a pair; 9, 20, 50 and 200 are the lengths most charts use, for no deeper reason than that most charts use them.
Two ways to write a condition
- Price against one average. Price above, price below, price crosses above, price crosses below. The usual way to say "the market is above its 200-day".
- One average against another. A fast and a slow average on the same chart: fast above slow, fast below slow, fast crosses above slow, fast crosses below slow. The classic crossover.
EMA on 4h · fast(20) above slow(50)
EMA on 15m · price crosses above · EMA(20)
Crossing, or being above: the difference that decides your alerts
This is the thing worth understanding before you save a strategy. Above is a state: it is true for every bar the fast average sits over the slow one, which might be weeks. Crosses above is a moment: it is true on the one bar where the fast average moves through the slow one, and false again on the next.
Alerts fire when a strategy goes from not satisfied to satisfied, so a strategy whose only condition is fast above slow alerts once at the start of the stretch and then stays quiet while it holds. A strategy using crosses above alerts at the cross and is unsatisfied again a bar later. Use the state when the average is describing the context a strategy needs, and the crossing when it is the event the strategy is waiting for.
The usual arrangement
A slow average on a higher timeframe as the context — price above EMA(200) on the daily — and a faster condition on a lower timeframe as the trigger, which is often an RSI or a crossing on the 15-minute or 1-hour chart. The slow condition is true for long stretches and rarely transitions; the fast one does the firing. Stacking three averages of neighbouring lengths on one timeframe adds little that one of them did not already say.
What a moving average does not know
It lags by construction: it is an average of bars that have already closed, so it describes where price has been, and a crossing confirms a move that has already begun. That is not a flaw to fix; it is what the indicator is. Whether a strategy built on it did anything useful on a given market is a question for the entry check and the backtest, not for the indicator.