CE Market SolutionsTest your own version of this rule on 10 years of NQ.Backtest your version →

Explainer

What is the 9 EMA and 21 EMA?

The 9 EMA and 21 EMA are exponential moving averages of the close over 9 and 21 bars; the shorter one reacts faster, so traders compare the two.

Updated

The short answer

The 9 EMA is an exponential moving average of the closing price over the last 9 bars. The 21 EMA is the same thing over the last 21 bars. Both are drawn as lines on the chart.

The 9 line sits close to price and turns quickly. The 21 line is smoother and turns later. People read the two together: where the lines sit, which one is above, and where they cross.

EMA
Exponential moving average. An average of recent closes that gives the newest bars the most weight.
Period
The number of bars the average looks back over. In the 9 EMA the period is 9.
Crossover
The bar on which a faster average moves from one side of a slower average to the other.
Bar
One period of price on a chart: the open, the high, the low and the close.

How it is calculated

Each new EMA value is built from the close and the previous EMA value. The formula is: EMA today = close × k + EMA yesterday × (1 − k), where k = 2 ÷ (period + 1).

For the 9 EMA, k is 2 ÷ 10, which is 0.2. For the 21 EMA, k is 2 ÷ 22. A bigger k means the newest close counts for more, which is why the shorter average hugs price.

The first EMA value has to start from something, usually a simple average of the first bars. After that, the old values fade out but never fully disappear. That is the difference from a simple average, which drops a bar completely once it leaves the window.

How people use the pair

Most uses come down to three readings. Price above both lines is read as an upward lean, and price below both as a downward lean. The 9 above the 21 is read the same way. A cross of the two lines is read as a change in that lean.

Some traders treat the 21 line as a place price may pause on a pullback. Others use the 9 as a trailing guide. These are habits, not rules. The lines describe where price has been. They do not say where it goes next.

An EMA is a smoothed record of past closes. It describes the recent past and says nothing about the next bar.

What the pair cannot tell you

When price moves sideways, two fast averages cross again and again. Each cross looks like a signal and each one can be undone a few bars later. A crossover says the average changed direction. It does not say the move will continue.

It also says nothing about size. A cross on a quiet bar and a cross on a wide bar look the same on the chart. And it carries no stop or target. You still have to decide where you are wrong and where you get out.

The futures angle

The period is counted in bars, so the chart timeframe decides what 9 and 21 mean. On a 1-minute chart they cover 9 and 21 minutes. On a daily chart they cover 9 and 21 sessions.

Rules built on a pair of averages tend to trade often, and futures costs are flat per contract per side. The more often a rule trades, the more often it pays that cost. In our builder, a moving-average cross is one of the presets you can start from.

You can write the rule down and test it on past data, with costs, instead of judging it by eye. Replay it on real NQ data, free, in the Trade Lab.

Questions and answers

What does the 9 EMA tell you?

It shows the average of the last 9 closes with the newest bars weighted most. It follows price closely and turns quickly.

What does the 21 EMA tell you?

It shows the same kind of average over 21 bars. It is smoother than the 9 EMA and reacts later to a change in direction.

What happens when the 9 EMA crosses the 21 EMA?

It means the faster average has moved from one side of the slower one to the other. It records that the recent closes changed direction relative to the older ones. It does not say what price does next.

Is the EMA better than a simple moving average?

It is different. An EMA weights recent bars more, so it reacts faster. A simple average weights every bar in the window equally, so it is smoother.

Can I test a 9 and 21 EMA rule on futures?

Yes. Write the rule so it can only be read one way, add commission and slippage, and run it on past data. A backtest shows what the rule would have done, not what it will do.