6-month high, 50/200-day trend, 20-day-low trailing stop
Buy stocks at a 6-month high with the 50-day average above the 200-day, trailing a stop at the 20-day low.
Survivorship mirage
It clears the bar on today's winners, the stocks everyone wishes they had bought, but not on the laggards, which is where hindsight can't help.
- It clears the bar on today's winners but not on the laggards: the winners' own rise did the work.
42 large US stocks, 15 years
Before costs −0.008R
By trade and by day, sized to a first try
What the numbers say
On the 22 laggards, 4123 trades averaged −0.080R after costs, yet the same rules on today's 20 winners averaged 0.086R. Every market type was negative on the laggards: bull −0.056, flat −0.212, bear −0.209. The winners' own rise explains the gain, hence the survivorship mirage verdict.
How it was tested
Buy at the close when a stock makes a new 6-month closing high while its 50-day average is above its 200-day, then exit if the close falls below the prior 20-day low.
- Side
- Long
- Its own exit
- At each close after entry, exit at that close if the close is below the lowest low of the previous 20 trading days (excluding the current day)., checked at each close
- 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.01, by trade and by day, sized to a first try (one idea, tested once)
- Prices
- 15 years of daily bars through 2026-11-20; judged 2026-11-22
- 6 months = 126 trading days, measured on closing prices
- New high means the close is the highest close in the last 126 days including today
- 20-day low = lowest daily low of the prior 20 bars, checked at the close (close-based trail, not intraday)
- Initial stop and target are wide protective levels (4 x ATR and 12 x ATR) since the trailing exit is the idea's real stop
- Time limit set to the harness maximum of 30 trading days
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 | 3,488 | −0.056R | −3.32 | 0.20 · 1,633d | −0.026R · beats 20% | +0.094R |
| Flat | 531 | −0.212R | −5.92 | −2.37 · 296d | −0.051R · beats 0% | +0.035R |
| Bear | 104 | −0.209R | −2.70 | −3.48 · 74d | +0.064R · beats 0% | −0.191R |
| All | 4,123 | −0.080R | −0.027R | +0.086R |
R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 13.6 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, sma
from scanners.base import Candidate
class SixMonthHighTrendFilter20dLowTrail:
name = "six_month_high_trend_filter_20d_low_trail"
description = "Long on 126-day closing high with SMA50 > SMA200; exit when close < prior 20-day low."
def __init__(self, high_lookback: int = 126, fast: int = 50, slow: int = 200,
atr_period: int = 14, stop_mult: float = 4.0,
target_mult: float = 12.0, trail_lookback: int = 20) -> None:
self._high_lookback = high_lookback
self._fast = fast
self._slow = slow
self._atr_period = atr_period
self._stop_mult = stop_mult
self._target_mult = target_mult
self._trail_lookback = trail_lookback
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
need = max(self._slow, self._high_lookback, self._atr_period + 1)
if len(bars) < need:
return None
closes = [b.close for b in bars]
current = bars[-1]
window = closes[-self._high_lookback:]
if current.close < max(window):
return None
fast_v = sma(closes, self._fast)
slow_v = sma(closes, self._slow)
if fast_v is None or slow_v is None:
return None
if Decimal(str(fast_v)) <= Decimal(str(slow_v)):
return None
atr_val = atr(bars, self._atr_period)
if atr_val is None or atr_val <= 0:
return None
atr_dec = Decimal(str(atr_val))
entry = current.close
stop = entry - Decimal(str(self._stop_mult)) * atr_dec
target = entry + Decimal(str(self._target_mult)) * atr_dec
risk = entry - stop
if risk <= 0 or stop <= 0:
return None
rr = (target - entry) / risk
return Candidate(
ticker=ticker,
side="buy",
entry=entry,
stop=stop,
target=target,
risk_reward_ratio=rr.quantize(Decimal("0.01")),
signal_strength=50,
thesis="New 126-day closing high with SMA50 above SMA200.",
)
def exit_now(self, ticker: str, bars: list[Bar], entry: Decimal,
side: str, bars_held: int) -> bool:
if side != "buy":
return False
if len(bars) < self._trail_lookback + 1:
return False
prior = bars[-(self._trail_lookback + 1):-1]
low20 = min(b.low for b in prior)
return bars[-1].close < low20
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.