Tight range just below the 52-week high, long breakout
Entry at latest close if close is within 3% of the 252-day high, the last 4 bars each have range below 0.9*ATR(14), and the close is the highest close of those 4 bars. Stop = lowest low of the last 4 bars minus 0.2*ATR(14). Target = entry + 2.2*ATR(14).
Stocks within 3% of the 52-week high that coil in a tight band for a week are anchored by traders who treat the high as a reference point; those underweight the stock feel pressure to catch up, and breakouts trigger buy stops placed above the high. Evidence is two to four small-range bars right at the high.
Loses money
After costs it lost money on the stocks that decide the verdict.
- −0.197R a trade after costs on the laggard stocks.
42 large US stocks, 15 years
Before costs −0.073R
By trade and by day, sized to 362 rules
What the numbers say
On 398 laggard-stock trades the idea averaged −0.197R after costs (−0.073R before costs); the 20 winners were also negative at −0.019R. In bull markets, 336 trades averaged −0.202R, beating only 5% of random-date draws, so entering at the high did worse than random dates. Flat (−0.098R) and bear (−0.361R) markets were also negative, so the loss is not limited to one market state.
How it was tested
The rule as written, coded once, run on every stock the same way.
- Side
- Long
- Time limit
- Exit at the close after 30 trading days, unless the stop, the target or its own exit comes first
- Bar to clear
- t > 2.95, by trade and by day, sized to the 362 rules in the search it came from
- Prices
- 15 years of daily bars through 2026-11-20; judged 2026-11-22
The evidence
The laggards decide: 22 large stocks that lagged or fell, where hindsight can't flatter a rule. Today's winners sit beside them to show what survivorship would add.
| Market | Trades | Per trade | t, by trade | t, by day | Random dates | Winners, per trade |
|---|---|---|---|---|---|---|
| Bull | 336 | −0.202R | −2.52 | −2.41 · 254d | −0.049R · beats 5% | −0.041R |
| Flat | 45 | −0.098R | −0.34 | −0.81 · 38d | +0.004R · beats 30% | +0.280R |
| Bear | 17 | −0.361R | −1.17 | −0.13 · 11d | +0.065R · beats 5% | −0.237R |
| All | 398 | −0.197R | −0.038R | −0.019R |
R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 10.2 bps) plus 0.045R for the fills a real order wouldn't get. “By day” groups trades opened the same day, so a rule that fires on the same dates for every stock counts as a few events. “Random dates” places the same plan on random days of the same stocks in the same kind of market, 20 times; the idea must beat 95% of those draws.
The scanner we wroteShow the codeHide
from decimal import Decimal
from core.domain import Bar
from strategies.indicators import atr
from scanners.base import Candidate
class InsideCoil52wkHighLong:
name = "inside_coil_52wk_high_long"
description = "Tight 4-bar coil within 3% of the 252-day high, closing at the coil's highest close"
def __init__(self, high_lookback: int = 252, coil_bars: int = 4, proximity_pct: float = 0.03,
range_atr_max: float = 0.9, stop_atr_buf: float = 0.2, target_atr_mult: float = 2.2,
atr_period: int = 14) -> None:
self._hl = high_lookback
self._n = coil_bars
self._prox = proximity_pct
self._rmax = range_atr_max
self._buf = stop_atr_buf
self._tmult = target_atr_mult
self._atrp = atr_period
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
if len(bars) < self._hl + 2:
return None
atr_val = atr(bars, self._atrp)
if atr_val is None or atr_val <= 0:
return None
atr_d = Decimal(str(atr_val))
current = bars[-1]
entry = current.close
if entry <= 0:
return None
hh = max(b.high for b in bars[-self._hl:])
if hh <= 0:
return None
if entry < hh * (Decimal(1) - Decimal(str(self._prox))):
return None
coil = bars[-self._n:]
rmax = Decimal(str(self._rmax)) * atr_d
ranges = [b.high - b.low for b in coil]
if any(r >= rmax for r in ranges):
return None
if entry < max(b.close for b in coil):
return None
coil_low = min(b.low for b in coil)
stop = coil_low - Decimal(str(self._buf)) * atr_d
target = entry + Decimal(str(self._tmult)) * atr_d
risk = entry - stop
if risk <= 0 or target <= entry:
return None
rr = (target - entry) / risk
if rr < Decimal("1.5"):
return None
# Tightness: average coil range relative to ATR (lower is better)
avg_range_ratio = float(sum(ranges) / len(ranges) / atr_d)
tight_score = int(max(0.0, min(1.0, (0.9 - avg_range_ratio) / 0.6)) * 40)
# Proximity to the high (closer is better)
dist = float((hh - entry) / hh)
prox_score = int(max(0.0, min(1.0, 1.0 - dist / self._prox)) * 35)
# Volume dry-up in the coil vs the prior 50 bars
prior = bars[-(50 + self._n):-self._n]
avg_prior = float(sum(b.volume for b in prior)) / max(len(prior), 1)
avg_coil = float(sum(b.volume for b in coil)) / len(coil)
vol_ratio = avg_coil / avg_prior if avg_prior > 0 else 1.0
vol_score = int(max(0.0, min(1.0, (1.3 - vol_ratio) / 0.6)) * 25)
strength = max(0, min(100, tight_score + prox_score + vol_score))
return Candidate(
ticker=ticker,
side="buy",
entry=entry,
stop=stop,
target=target,
risk_reward_ratio=rr.quantize(Decimal("0.01")),
signal_strength=strength,
thesis=(
f"{self._n}-bar tight coil (avg range {avg_range_ratio:.2f}x ATR) within "
f"{dist * 100:.1f}% of the 252-day high, closing at the coil's highest close; "
"anchoring on the 52-week high plus buy stops above it should drive a breakout. "
"Stop below the coil low, target +2.2 ATR."
),
)
Hypothetical results from our own backtest of the rule as restated, on 42 large US stocks over 15 years. Past performance, real or simulated, does not predict future results. Research and education only; not investment advice.
Describe it in plain words and get the same honest test in about a minute.