Close above the 50-day average for the first time in a month
Buy when the price closes above its 50-day moving average for the first time in a month.
Loses money
After costs it lost money on the stocks that decide the verdict.
- −0.049R a trade after costs on the laggard stocks.
42 large US stocks, 15 years
Before costs +0.040R
By trade and by day, sized to a first try
What the numbers say
On the 22 laggard stocks, 579 trades averaged −0.049R after costs, which is why the verdict is a loss; before costs it was 0.040R. Bull markets came to −0.116R and flat markets to −0.114R, while bear markets showed 0.418R (t 2.92). The 20 winners averaged 0.232R.
How it was tested
Buy at the close when the stock closes above its 50-day simple moving average for the first time in about a month (21 trading days), then exit by stop, target, or time.
- Side
- Long
- Time limit
- Exit at the close after 20 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
- 'A month' = 21 trading days with no close above the 50-day SMA
- Moving average is a simple moving average of closes
- 'Closes above' means close strictly greater than the SMA
- Stop chosen as 2 x ATR(14) below entry since the idea names none
- Target chosen at twice the risk (4 x ATR(14)) since the idea names none
- Maximum hold chosen as 20 trading days since the idea names none
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 | 395 | −0.116R | −1.77 | −1.78 · 331d | −0.041R · beats 15% | +0.081R |
| Flat | 111 | −0.114R | −0.86 | −0.55 · 91d | −0.019R · beats 25% | +0.340R |
| Bear | 73 | +0.418R | 2.92 | 2.10 · 55d | +0.140R · beats 100% | +0.631R |
| All | 579 | −0.049R | −0.014R | +0.232R |
R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 11.7 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 FirstCloseAbove50DmaAfterMonth:
name = "first_close_above_50dma_after_month"
description = "First close above the 50-day SMA after 21 closes at or below it"
def __init__(self, sma_period: int = 50, quiet_days: int = 21, atr_period: int = 14, stop_mult: float = 2.0, target_mult: float = 4.0) -> None:
self._sma_period = sma_period
self._quiet_days = quiet_days
self._atr_period = atr_period
self._stop_mult = stop_mult
self._target_mult = target_mult
def _sma_at(self, closes, idx):
p = self._sma_period
window = closes[idx - p + 1: idx + 1]
return sum(window) / Decimal(p)
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
n = len(bars)
p = self._sma_period
q = self._quiet_days
if n < p + q or n < self._atr_period + 1:
return None
closes = [Decimal(str(b.close)) for b in bars]
t = n - 1
if closes[t] <= self._sma_at(closes, t):
return None
for k in range(t - q, t):
if closes[k] > self._sma_at(closes, k):
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 = bars[-1].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=f"First close above the {p}-day SMA after {q} closes at or below it.",
)
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.