This scan finds potential set ups for medium term trades.
A strong stock that ventures into the lower 20% of its monthly (21 day) range may offer an opportunity for good gains over longer term than the K10 set up, although like the xxx set up in the K10 discussion, the two sometimes overlap.
The scan is essentially the same as the K10 with the parameters changed for K 21. See the K10 discussion for comments explaining the scan code.
// 00 30 020 K21 xb 20 hits in STOCKS
[[exchange is NYSE] or [exchange is NASDAQ]]
and
[ // sectors open bracket
[[market cap > 100] and [group is EnergySector]]
or [[market cap > 100] and [group is MaterialsSector]]
or [[market cap > 100] and [group is IndustrialSector]]
or [[market cap > 100] and [group is ConsumerDiscretionarySector]]
or [[market cap > 100] and [group is ConsumerStaplesSector]]
or [[market cap > 100] and [group is HealthCareSector]]
or [[market cap > 1000] and [group is FinancialSector]]
or [[market cap > 100] and [group is TechnologySector]]
or[[market cap > 100] and [group is CommunicationServicesSector]]
or [[market cap > 100] and [group is UtilitiesSector]]
or[[market cap >100] and [group is RealEstateSector]]
] // sectors close bracket
and [symbol not contains '/']
and [sma(21,volume) > 1000000]
and [close < 20]
and [close > sma(251,close)] // this replaces the SCTR > 70; see below for why
// get first close or low into the bottom 20 per cent of the last 10 days' range
// avoid second or third crosses
// K21 has been above 80 in the last 20 days
and [max(20, Fast Stoch %K(21,1)) > 80]
// K21 has not been below 20 in the last 5 days
and [1 day ago min(5, Fast Stoch %K(21,1)) > 20]
// check for low xb 20 AND K21 xb 20- strong stocks may not close xb 20; moving LPC may be too far from 20?
and
[
[ 1 day ago min(21, low) + [ [1 day ago max(21, high) - 1 day ago min(21,low)] *.2] x low ]
or
[20 x Fast Stoch %K(21,1) ]
]
rank by SCTR
Here's an example that worked very well; don't expect them all to work like this. GRPN was a hit on 4/28/25 because of the long tail, and then again on May 6 because of K21 xb (cross below) 20

Like JBGS in the K10 discussion, GRPN doesn't retrace below MA 3 of highs when it takes off. You could anticipate this by entering a buy stop each day after the scan hit just above the MA 3 of highs, if you are OK with the possible wider draw down (to your stop under the Lower Price Chan(21) if the trade tanks.
Again, this set up was good because this was the first retreat from a breakout after a fairly long consolidation range. Note that there was a K10 entry earlier that fit all the entry criteria but was disappointing. There doesn't seem to be any way to avoid this. You can prevent a serious loss by putting a stop under the MA 3 of lows (blue line), but not too close to avoid noise. Maybe choose the MA 3 of lows two days before the current day and move it up after momentum slows down. These are trades, not investments, so its OK to get stopped out with a gain.
A note on 'close above sma 251' in this scan vs. SCTR > 70 in the K10 example. Use 'close abv 251' for research running scans on paste dates but use SCTR for current date scans if you decide to try it. It seems that if you include SCTR in your research scan, Stockcharts uses *today's* SCTR value even if you set the scan date back to a past date. That will skew the results toward set ups that work (because SCTR improves between the scan date and today's date), giving you an unrealistic picture what the scan picks up. Often, only one or two of maybe 20 hits will work out.
The important things to look for on a scan hit chart are the consolidation period (not shown on this chart - its too the left before the chart begins) and breakout, and (add these to your chart style) either $SYMBOL:$INDUSTRY generally rising (the green dots on my chart) or $SYMBOL:$SECTOR generally rising (the orange dots). On the GRPN chart, you can see GRPN:$INDUSTRY (the green dots) picked up and gradually settled back to its rising 63 day MA (the green solid line). In fact, the trade occurs just when the dotted line gets back to the MA. Maybe just a coincidence, but too bad you can't scan for that event.