ChalniTry the demo

Trend scan

Stacked Moving Averages Screener

This scan finds stocks whose moving averages are stacked in order: price above the 20-day EMA, the 20-day EMA above the 50-day SMA, the 50-day above the 200-day, and an RS rating above 70.

Run this scan in the live demoFree, no sign-up. The demo uses made-up sample data.

The exact rule

Type this in Chalni: close above 20 ema and 20 ema above 50 day sma and 50 day sma above 200 day sma and rs rating above 70

  1. Close > EMA(20)
  2. EMA(20) > SMA(50)
  3. SMA(50) > SMA(200)
  4. RS rating(126) > 70

Find US stocks where the closing price is above the 20-day exponential moving average; and the 20-day exponential moving average is above the 50-day simple moving average; and the 50-day simple moving average is above the 200-day simple moving average; and the RS rating (126 days, 1–99) is above 70.

Formula view
close > ema(close, 20)
AND ema(close, 20) > sma(close, 50)
AND sma(close, 50) > sma(close, 200)
AND rs_rating(126) > 70
Example chart: Trend leaders (averages in order)Daily candles of a made-up sample stock with 20-day EMA; 50-day SMA; 200-day SMA; Lower panel: RS rating (1 to 99), dotted line at 70. The shaded day is the day the scan fired.
  • 20-day EMA
  • 50-day SMA
  • 200-day SMA
  • Lower panel: RS rating (1 to 99), dotted line at 70
  • Shaded day: the scan fired
Example from Chalni's made-up sample market, not a real stock. It shows the most recent time this scan fired in the sample US market, picked whether or not the trade worked.

What it means

When the short, medium and long averages line up from fast to slow, every time frame agrees that the trend is up. Traders call this "stacked" or "in order". It describes a healthy uptrend at a glance.

The RS rating (1 to 99) compares the stock's gain over about 6 months with every other stock in its market. Above 70 means it beat at least 70% of them. Together, the rules find stocks that are both trending and leading.

How traders use it

  • A good starting list for swing traders who only want to buy strong stocks.
  • Wait for a pullback toward the 20-day EMA instead of chasing a big up day.
  • When the stack breaks (price closes below the 50-day), many traders reduce or exit.

Watch out for

  • Late in a long trend, stocks can stay stacked while they get very stretched. Check the distance from the 50-day average.
  • This scan describes a state, so the same stocks can show up for weeks. Use it for watchlists, not daily signals.

Test it before you trust it

Every scan in Chalni sits an exam. First it runs on older data, the practice: each time it picks a stock, the stock is held for 10 trading days and 0.2% is paid in costs. Then it runs on newer data it has never seen, the exam. A scan that only works in practice has just memorised the past.

See the practice and exam results for this scan in the demo (on sample data; real data comes at launch).

Questions

Why use the 20, 50 and 200 day moving averages?

They roughly match one month, one quarter and one year of trading. Many traders watch them, so they often act as support.

What is an RS rating?

A score from 1 to 99 that ranks a stock's price gain against the other stocks in its market. Chalni uses the last 126 trading days, about 6 months.

Related scans