Skip to content
CFDs are leveraged products. Trading carries a high risk of losing money.Help center
FXBITI

A moving average is a technical indicator that smooths a sequence of prices into a single line. Instead of reacting to every small fluctuation, it shows the average price over a selected number of periods. Traders often use this line to identify trend direction, compare short term and long term momentum, or filter possible trade setups.

The indicator describes past price behavior. It does not predict the next movement, and it cannot remove trading risk. Its value comes from applying a consistent calculation to noisy market data.

How moving averages are calculated

Every moving average has a period. A 10 period moving average uses the latest 10 candles, whether those candles represent minutes, hours or days. When a new candle is completed, the calculation adds the newest value and removes or reduces the influence of older data.

Simple moving average

A simple moving average, or SMA, gives equal weight to every price in the calculation. The formula is:

SMA = sum of selected prices divided by the number of periods

Imagine five hypothetical closing prices: 100, 102, 101, 104 and 103. The five period SMA is calculated as follows:

(100 + 102 + 101 + 104 + 103) / 5 = 510 / 5 = 102

If the next closing price is 106, the oldest value of 100 leaves the calculation. The updated SMA becomes:

(102 + 101 + 104 + 103 + 106) / 5 = 516 / 5 = 103.2

The line rises because the newer set of prices has a higher average. Each included price still contributes equally.

Exponential moving average

An exponential moving average, or EMA, assigns more weight to newer prices. Its weighting multiplier is:

2 / (period + 1)

For a five period EMA, the multiplier is 2 / 6, or approximately 0.333. If the previous EMA were hypothetically 102 and the new closing price were 106, the updated value would be:

EMA = (106 minus 102) x 0.333 + 102 = 103.33

The full calculation continues from one period to the next. Because recent observations receive greater weight, an EMA usually changes direction faster than an SMA with the same period.

Why moving averages lag price

Lag is the delay between a price movement and the indicator response. Moving averages lag because they are calculated from completed or developing price data. A longer period includes more observations, so one new price has less influence on the result.

  • Shorter averages respond faster but change direction more often.
  • Longer averages respond more slowly but filter out more small fluctuations.
  • EMAs generally react faster than equivalent SMAs because recent prices receive more weight.

Faster does not automatically mean better. A responsive average can produce frequent false changes during sideways conditions. A slower average may avoid some noise, but it can identify a new trend only after a substantial move has occurred. Period selection is therefore a tradeoff between responsiveness and stability.

Using a moving average as a trend filter

A trend filter does not need to create entry signals by itself. It can establish a directional condition that another setup must satisfy. For example, a trader might consider long setups only when price is above a chosen moving average and the average is rising. Short setups might require price below a falling average.

The slope adds useful context. Price can briefly cross above a declining average without establishing an upward trend. Requiring both position and slope may reduce weak signals, although it will also create additional delay.

The chart interval matters. A 20 period average on an hourly chart summarizes 20 hourly candles, while the same setting on a daily chart summarizes 20 daily candles. The number alone has no meaning without the timeframe and the price input, such as closing price.

What moving average crossovers show

A crossover compares two averages with different periods. A bullish crossover occurs when the shorter average moves above the longer average. A bearish crossover occurs when the shorter average moves below it.

The mechanism is straightforward. When recent prices become stronger relative to the longer sample, the shorter average responds first and may cross upward. When recent prices weaken, it may cross downward. The signal confirms that momentum has already changed within the selected data. It does not prove that the movement will continue.

Crossovers tend to work more cleanly during sustained directional moves. In a narrow range, the averages can cross repeatedly as price moves back and forth. This behavior is often called whipsaw. Each signal can appear reasonable, yet repeated reversals may create several losing trades and transaction costs.

Common moving average mistakes

  • Treating a crossover as a complete strategy: A crossover does not define position size, stop placement, exit rules or acceptable risk.
  • Ignoring market conditions: Trend tools often struggle when price is moving sideways.
  • Testing many settings until one looks perfect: A setting fitted too closely to historical data may fail on new data.
  • Using an unfinished candle: A live candle can move above and below an average before closing, so an apparent signal may disappear.
  • Forgetting trading costs: Frequent crossover trades may accumulate spreads, commissions and financing charges.
  • Assuming the average is support or resistance: Price may react near an average, but the line is not a barrier and can be crossed without warning.
  • Changing rules after losses: Frequent adjustments make it difficult to judge whether a method has a repeatable advantage.

Practical testing checklist

  1. Choose one market, timeframe, price input and moving average type.
  2. Write an exact trend rule, such as price above a rising 50 period SMA.
  3. Define whether signals require a completed candle.
  4. Add separate rules for entry, stop placement, position size and exit.
  5. Test trending and sideways periods, including realistic trading costs.
  6. Record signal frequency, average loss, average gain and maximum drawdown.
  7. Use small risk if moving from testing to live execution, because historical results do not ensure future performance.

Educational content only, not investment advice. Leveraged trading can lose more than you expect.

FXBITI Insights

One email a week, nothing else

New explainers and glossary terms. No promotions.