Supertrend (10, 3): buy on up-turn, sell on down-turn
Supertrend (10, 3): buy when the supertrend turns up and sell when it turns down.
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.065R
By trade and by day, sized to a first try
What the numbers say
On the 22 laggards, 1147 trades averaged −0.002R after costs, against 0.153R on today's winners. Bull markets (−0.017) and flat markets (−0.045) were negative, and the bear-market t of 2.36 on trade count fell to 1.98 by distinct day. The edge shows up on the winners, not the laggards, so the verdict follows.
How it was tested
Buy at the close when the Supertrend(10, 3) indicator flips from downtrend to uptrend, and exit when it flips back down.
- Side
- Long
- Its own exit
- Exit at the close of the first day after entry on which the Supertrend(10, 3) trend turns from up to down (the 'sell when it turns down' leg)., 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
- Supertrend uses ATR(10) with Wilder smoothing and multiplier 3 on the (high+low)/2 midpoint, the standard definition.
- Only the long side is tested: buy on flip up, exit on flip down; the sell is treated as the exit, not a short entry.
- Entry is at the signal day's close, as the harness requires.
- Stop (4 x ATR(14)) and target (8 x ATR(14)) are wide protective choices since the idea's own exit is the indicator flip.
- Time limit set to the 30-day maximum so the flip exit normally decides the trade.
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 | 826 | −0.017R | −0.57 | −0.82 · 613d | −0.031R · beats 65% | +0.139R |
| Flat | 198 | −0.045R | −0.71 | −0.57 · 146d | −0.074R · beats 65% | +0.179R |
| Bear | 123 | +0.171R | 2.36 | 1.98 · 84d | +0.150R · beats 60% | +0.208R |
| All | 1,147 | −0.002R | −0.019R | +0.153R |
R is the result per trade in units of the risk taken (entry to stop). Costs are each stock's own trading spread (median 12.5 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 SupertrendFlipUpLong:
name = "supertrend_10_3_flip_up_long"
description = "Long when Supertrend(10,3) flips from down to up; exit on flip down."
def __init__(self, st_period: int = 10, st_mult: float = 3.0,
atr_period: int = 14, stop_mult: float = 4.0,
target_mult: float = 8.0) -> None:
self._p = st_period
self._m = st_mult
self._atr_period = atr_period
self._stop_mult = stop_mult
self._target_mult = target_mult
def _trends(self, bars):
n = len(bars)
p = self._p
out = [None] * n
if n < p + 2:
return out
highs = [float(b.high) for b in bars]
lows = [float(b.low) for b in bars]
closes = [float(b.close) for b in bars]
trs = []
for i in range(n):
if i == 0:
trs.append(highs[i] - lows[i])
else:
pc = closes[i - 1]
trs.append(max(highs[i] - lows[i], abs(highs[i] - pc), abs(lows[i] - pc)))
a = sum(trs[:p]) / p
i0 = p - 1
hl2 = (highs[i0] + lows[i0]) / 2.0
fu = hl2 + self._m * a
fl = hl2 - self._m * a
trend = 1 if closes[i0] > hl2 else -1
out[i0] = trend
for i in range(p, n):
a = (a * (p - 1) + trs[i]) / p
hl2 = (highs[i] + lows[i]) / 2.0
bu = hl2 + self._m * a
bl = hl2 - self._m * a
prev_fu = fu
prev_fl = fl
prev_close = closes[i - 1]
# trend uses prior bar's final bands
if closes[i] > prev_fu:
trend = 1
elif closes[i] < prev_fl:
trend = -1
# ratchet bands
if bu < prev_fu or prev_close > prev_fu:
fu = bu
else:
fu = prev_fu
if bl > prev_fl or prev_close < prev_fl:
fl = bl
else:
fl = prev_fl
out[i] = trend
return out
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
if len(bars) < 30:
return None
tr = self._trends(bars)
if tr[-1] is None or tr[-2] is None:
return None
if not (tr[-2] == -1 and tr[-1] == 1):
return None
atr_val = atr(bars, self._atr_period)
if atr_val is None or atr_val <= 0:
return None
a = Decimal(str(atr_val))
entry = bars[-1].close
stop = entry - Decimal(str(self._stop_mult)) * a
target = entry + Decimal(str(self._target_mult)) * a
risk = entry - stop
if risk <= 0 or stop >= entry or target <= entry:
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="Supertrend(10,3) flipped from downtrend to uptrend on today's close.",
)
def exit_now(self, ticker: str, bars: list[Bar], entry: Decimal,
side: str, bars_held: int) -> bool:
if len(bars) < 12:
return False
tr = self._trends(bars)
if tr[-1] is None or tr[-2] is None:
return False
return tr[-2] == 1 and tr[-1] == -1
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.