ChalniTry the demo

Breakouts scan

20-Day Breakout Screener

This scan finds stocks that closed above their highest price of the last 20 trading days (about one month), but only when the price is also above its 50-day moving average.

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 day high and close above 50 day sma

  1. Close > 20-day high
  2. Close > SMA(50)

Find US stocks where the closing price is above the highest high of the last 20 days; and the closing price is above the 50-day simple moving average.

Formula view
close > highest(high, 20, before_today)
AND close > sma(close, 50)
Example chart: 20-day breakout in an uptrendDaily candles of a made-up sample stock with 20-day high (before today); 50-day SMA. The shaded day is the day the scan fired.
  • 20-day high (before today)
  • 50-day SMA
  • 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

Buying a break of the 20-day high is one of the oldest trend-following rules. It is often called a Donchian channel breakout, after Richard Donchian, and a version of it was used by the famous Turtle traders in the 1980s. The idea: when price escapes its recent range, a new move may be starting.

The 50-day average rule keeps you on the side of the bigger trend. It filters out many breakouts that happen inside a downtrend.

How traders use it

  • Swing traders use it to catch the start of a new leg up.
  • Add a volume rule to skip breakouts that nobody joined.
  • A classic exit is a close below the 10-day low, the mirror of the entry rule.

Watch out for

  • In choppy, sideways markets, 20-day breakouts fail often. Expect many small losses between the big wins.
  • A close just a little above the old high slips back easily. Some traders want a close at least 1% above it.

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

What is a Donchian channel breakout?

A Donchian channel draws the highest high and the lowest low of the last N days. A breakout happens when price closes above the top line. This scan uses N = 20.

Is the 20-day breakout still a good strategy?

It catches big trends but has many false starts. Whether it beats simply holding stocks depends on the market and on costs, which is why Chalni tests it on data it never saw.

Related scans