
Write the selection question, read the exact rule and inspect both matching and excluded cases before saving the screen.
Write a selection question
Start by choosing between a sideways range and a retreat inside a trend. A narrow range can occur without a prior advance. A pullback needs a preceding direction and a measured move away from a recent high; the two selections should keep separate labels.
Read field units and lookback periods
Range width compares the highest high with the lowest low over 20 sessions. High 108 and low 100 give high ÷ low of 1.08, the default width boundary. The rule also requires close above SMA 50. Distances to averages and highs use percentages rather than dollars.
Compare another question before combining rules
Compare tight-range and uptrend-pullback presets first. Light volume can be added as another condition, but it does not change a wide pullback into a tight consolidation. Parenthesize alternatives before combining them with a shared trend condition.
securityType = "Stock" and indexMembership contains "SP500" and (close > sma200 and sma50 > sma200 and hi20FromHighPct <= -5 and hi20FromHighPct >= -15)Inspect a match and a boundary exclusion
Inspect the sequence of highs and lows. A low-range statistic does not identify a flag or triangle. A pullback becomes a different research case when the longer-term structure breaks; write that invalidation before studying the subsequent bars.
Change one condition at a time and compare a row just inside the threshold with one just outside it. A zero-match result means the selected population did not meet the whole rule for that session; it is not a reason to silently change the question.
Save a reproducible research definition
Save the expression through the editor’s Library workflow. Record the selected session, population and sort so a later run can be compared meaningfully. A saved scan preserves rules, while a watchlist preserves symbols; their results can change independently.
Continue with
Read our data and methodology notes for calculation context. This guide explains research tools and observations. It does not recommend a trade or investment.