Moving Average Crossover

Home / Day trading

Day trading

EMA crossover, explained.

A fast exponential average crossing a slower one is the version of the crossover most day traders meet first. Here is how it works, what is commonly used, and where it struggles.

How an EMA crossover works

An EMA crossover uses two exponential moving averages of different lengths on the same chart. The shorter EMA, the fast line, follows price closely. The longer one, the slow line, follows it loosely. When the fast line rises through the slow line, price has recently been stronger than its longer average: a bullish crossover. When it falls through, the reverse. The calculation is covered in the SMA vs EMA guide; the key property is that recent bars get more weight, so an EMA turns sooner than an SMA of the same length after a sudden move.

Pairs you will commonly see

These appear often in charting communities and platform defaults. They are commonly used, not recommended: popularity says nothing about whether a pair works for your market.

PairWhere you will see itCharacter
9 / 21Intraday charts on 1 to 15 minute barsQuick to react; many signals
8 / 21Close cousin of 9/21, uses Fibonacci numbersVery similar behaviour to 9/21
12 / 26The building blocks of MACDSlower than 9/21; fewer signals
20 / 50Swing and daily chartsSmoother, later
50 / 200Daily charts, EMA version of the golden crossVery slow; long-term context

The MACD connection

The MACD line is the 12-period EMA minus the 26-period EMA. That means the MACD line crosses zero at exactly the moment the 12 EMA crosses the 26 EMA, so a 12/26 EMA crossover and a MACD zero-line cross are the same event seen two ways. The more familiar MACD signal-line cross is different: it compares the MACD line with a 9-period EMA of itself.

Filters traders add

A raw crossover fires on every pass, good or bad. Traders commonly add conditions to be more selective. Each one is a trade-off: it removes some poor signals and some good ones too.

  • Trend filter. Take only crosses in the direction of a longer trend, for example price above a slower average or a higher-timeframe slope pointing the same way.
  • Separation or slope. Require the lines to be a minimum distance apart, or the slow line to be sloping, so that tangled, flat averages are ignored.
  • Volume and liquidity. Prefer crosses that come with participation, and be wary of thin periods when a handful of orders can move price.
  • Session and time. Behaviour differs around the open, midday and the close. Some traders avoid the quiet middle of the day or the minutes around major scheduled news.
  • Bar close. Wait for the bar to finish; a mid-bar cross can vanish by the close.

Steady trend: 0 crossings of a 9 and 21 EMA

Sideways range: 7 crossings of a 9 and 21 EMA

Two synthetic series with the same pair of EMAs (coral is 9, green is 21). Markers show every crossing. Illustration only, on randomly generated data, not a test of any approach.

Whipsaw: the real cost

A crossover works by following a trend. In a trend the fast line crosses once and stays on its side. In a range, price oscillates around a flat average, so the fast line keeps passing through the slow line: each cross arrives after the move, then reverses. That is whipsaw. If you act on every cross, each one costs commissions and slippage on top of the loss from entering late. This is the main reason a raw crossover rarely survives realistic costs unmodified, and why a lot of the work around it is about recognising when not to use it.

Risk and testing

A crossover tells you nothing about where to exit if you are wrong, how large to trade, or when to stop for the day. Decide those first. Then test the full rule, including costs, on data the design did not see; our best settings guide sets out how, and strategies.ninja on backtesting goes deeper. Trading futures and other leveraged products involves substantial risk of loss, and a simulator is a good place to learn what a rule feels like before real money is involved.

Putting it on a chart

In NinjaTrader Desktop you can add two EMA indicators in a minute; the NinjaTrader page gives the general steps and points to NinjaTrader Guru for the full walkthrough. Affordable Indicators builds tools for NinjaTrader 8, and the sister site indicators.ninja covers indicator ideas. You can also compare notes with other traders in the Discord community.

Frequently asked questions

What is the best EMA crossover for day trading?

There is no universally best pair. Pairs such as 9/21 or 8/21 are widely used, but whether any suits you depends on the instrument, the timeframe, the session and your costs. Test candidates on data you did not design them on; see the best settings guide.

Is the 12/26 EMA crossover the same as MACD?

Related. The MACD line is the 12-period EMA minus the 26-period EMA, so it crosses zero at exactly the moment the 12 EMA crosses the 26 EMA. The familiar MACD signal-line cross is a different event: the MACD line crossing its own 9-period EMA.

How do I reduce false EMA crossover signals?

Filters help but never remove false signals. Common ones are trading only in the direction of a higher-timeframe trend, requiring a minimum gap or slope between the lines, waiting for the bar to close, avoiding low-liquidity periods, and checking volume. Each filter also cuts out some good signals.

Why does an EMA crossover fail in a range?

In a sideways market price oscillates around a flat average, so the fast line keeps passing through the slow line without a trend to follow. Each crossing is late and reverses, which is called whipsaw, and costs commissions and slippage.

Should I trade on the bar close or as soon as the lines cross?

Crossings that appear mid-bar can disappear before the bar closes. Waiting for the close avoids those but is slower. It is a trade-off worth testing rather than assuming.

Keep reading