By Scalpel Team. , updated . 9 min read.

In short
The 9 and 20 EMA are exponential moving averages of the last closes: each new bar moves the line by 2 / (period + 1) of the gap between the close and the old average, so 20% for the 9 EMA and about 9.5% for the 20. In day trading, price riding above a rising 9 EMA with the 9 above the 20 describes a strong short-term trend; a pullback that holds the 9 is shallow, and losing the 20 usually means the push is over. They lag by design and they do not predict: decades of research on moving average rules, including intraday tests, find no reliable profit once data snooping is accounted for.
The 9 and 20 EMA pair is the most common moving average setup on small-cap momentum charts. It is simple, it is on almost every screenshot, and it is often explained as if the lines themselves had some power. They do not. They are two weighted averages of recent closes, one fast and one slow. This post works through the formula with real numbers, shows what 9 and 20 bars mean on 1-minute and 5-minute charts, covers how traders use the pair as a trend filter, and summarizes what the research on moving average rules actually found.
A simple moving average (SMA) of 9 bars is the plain average of the last 9 closes: each close counts one-ninth, and on the tenth bar the oldest drops off a cliff. An exponential moving average (EMA) weights the newest close most and lets older ones fade gradually, so it turns sooner and never jumps when an old bar leaves the window.
The formula, for a period of N bars:
k = 2 / (N + 1)
EMA now = close x k + EMA before x (1 - k)
For the 9 EMA, k = 2 / 10 = 0.2. For the 20 EMA, k = 2 / 21 = 0.0952. The line needs a starting value: most platforms, ours included, seed it with the simple average of the first N closes and then apply the formula bar by bar. The definition is also in our glossary entry for EMA.
Say a fictional stock, WXYZ, has a 9 EMA of 5.0000 and a 20 EMA of 4.9500 on its 1-minute chart, and the next four bars close at 5.10, 5.20, 5.05 and 4.98.
| Bar | Close | 9 EMA | 20 EMA |
|---|---|---|---|
| Start | 5.0000 | 4.9500 | |
| 1 | 5.10 | 5.0200 | 4.9643 |
| 2 | 5.20 | 5.0560 | 4.9867 |
| 3 | 5.05 | 5.0548 | 4.9928 |
| 4 | 4.98 | 5.0398 | 4.9915 |
Bar 1, the 9 EMA: 5.10 x 0.2 + 5.0000 x 0.8 = 1.02 + 4.00 = 5.0200. The 20 EMA: 5.10 x 0.0952 + 4.9500 x 0.9048 = 4.9643.
Over the two green bars the 9 EMA rose 5.6 cents and the 20 EMA only 3.7. On bar 3, a red bar that closes above both, the 9 barely moves and the 20 keeps rising: a pullback holding the 9. On bar 4, the close at 4.98 is under both lines. The 9 EMA has turned down, and the stock has given back the push. Nothing in the numbers says what bar 5 will do.

Unroll the formula and each past close gets a weight that shrinks by a factor of (1 - k) per bar:
| 9 EMA | 20 EMA | |
|---|---|---|
| Weight on the latest close | 20.0% | 9.5% |
| Weight on the close before | 16.0% | 8.6% |
| Share of weight in the last N bars | 86.6% | 86.5% |
| Average age of the weights | 4 bars | 9.5 bars |
The last two rows explain both lines. Each EMA puts about 87% of its weight on its last N bars, which is why a 9 EMA behaves roughly like a 9-bar average. And the average age of the weights, (1 - k) / k, is how far behind price the line sits in a steady trend: 4 bars for the 9, 9.5 bars for the 20.
What that means in time depends on the chart:
| Chart | 9 EMA lag | 20 EMA lag |
|---|---|---|
| 10-second | 40 seconds | 95 seconds |
| 1-minute | 4 minutes | 9.5 minutes |
| 5-minute | 20 minutes | 47.5 minutes |
On a small cap that can run 20% in five minutes, a line that is 4 minutes behind is a description of the move you just watched. That is not a flaw, it is what an average is.
There is nothing special in 9 and 20. They are conventions: a fast line short enough to hug a strong 1-minute trend and a slow one about twice as long. The 8 and 21 pair, common in other circles, is nearly identical: k = 0.222 for the 8 and 0.091 for the 21, against 0.2 and 0.095.
If anything gives 9 and 20 a role, it is that so many momentum traders watch them, so a pullback to the 9 on a hot stock is where a lot of people look to buy. That is a reason to know where the lines are, not evidence that they work. We know of no study showing that 9 and 20 beat other lengths intraday. Pick a pair, keep it, and learn what it looks like on the stocks you trade.
Traders use the pair as a trend filter and as a place to look, not as a trigger.
| What you see | What it describes | What traders do with it |
|---|---|---|
| Price above a rising 9, 9 above 20 | A strong short-term trend | Look for longs only; pullbacks toward the 9 are the entries |
| Pullback holds the 9 and the next candle makes a new high | Buyers stepped in early; the pullback was shallow | Some buy the first candle to make a new high, stop under the pullback low |
| Pullback loses the 9 but holds the 20 | A deeper pullback | Smaller size, or wait for the 9 to be reclaimed |
| Close under the 20, 9 turning down | The push has stalled or failed | Longs exit or tighten; no new longs |
| 9 and 20 flat and tangled | No trend | Sit out: every cross is noise |
The second row is the shape of a bull flag and of the first pullback strategy: the EMA is just a visual guide to how deep the pullback went. The stop goes under the pullback low, a real price, not under the EMA, which moves.
A 9/20 crossover strategy (buy when the 9 crosses above the 20, sell when it crosses back) is the version most often backtested, and the lag table above shows its weakness: on a 1-minute chart, the cross comes minutes after the turn. On a fast stock that is most of the move.
Use two timeframes. A 1-minute chart with the 9 above the 20 inside a 5-minute chart that is still below its own 20 is a bounce in a downtrend, not a trend. Many traders only take 1-minute pullback entries when the 5-minute 9 and 20 point the same way. Add VWAP and you have the standard three-line read: above VWAP, 9 over 20, both rising.
Moving average rules are some of the most tested ideas in finance.
Read together: the more carefully moving average rules are tested, and the shorter the horizon, the less is left. That fits how we use EMAs, as a fast way to see the trend and the depth of a pullback, while the trade's risk is set by real prices on the chart. Our pillar on the best chart setup for day trading covers the rest of the evidence.
On a TWS chart, open Edit > Chart Parameters and go to the Studies tab.
Expand Moving Averages on the left, choose the exponential moving average, click Add, and set the period to 9 on closes.
Repeat with a period of 20, and give the two lines colors you can tell apart at a glance.
In the chart time options on the Chart Parameters tab, choose whether to show data outside regular trading hours. With pre-market bars included, the EMAs at 09:30 already reflect the morning; without them, the lines carry over from the prior afternoon.
The menu paths are from IBKR's guide to short-term indicators in TWS, checked on October 22, 2026. IBKR's chart lesson shows the Chart Parameters panel and the Studies tab on screen:

That last step matters more than it looks. On a gapper, a 1-minute 9 EMA computed with pre-market bars starts the session near the pre-market price; one computed without them starts near yesterday's close, possibly 40% lower, and spends the first minutes catching up. Two traders looking at "the 9 EMA" at 09:32 can be looking at very different lines.
Scalpel's chart draws the 9 EMA in blue and the 20 in orange on every desk, on by default, from 10-second to daily candles. They are seeded with a simple average and computed with the k = 2 / (N + 1) formula above, so the numbers you work out by hand match the lines. The lengths are not in the chart cog; they can only be changed in Scalpel's settings file (chart basics, panel settings).
The read bar above the chart puts the EMA fact in words, EMAs up when the 9 is at or above the 20 and EMAs down otherwise, next to Above VWAP or Below VWAP, so you do not have to squint at two lines in a fast move (read line and read bar). It is a description, not a signal. How these lines fit into the small-cap routine is in the momentum method guide, and our two-minute video shows the chart with the book and tape:

Scalpel is long only, and its stops are app-monitored rather than resting at IBKR, so they only work while Scalpel runs with a live feed. Scalpel is independent and not affiliated with or endorsed by Interactive Brokers.
Trading carries a significant risk of loss. Nothing here is financial advice.