On-balance volume 50-day high before the price does
Buy when on-balance volume makes a 50-day high before the price does.
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.015R
By trade and by day, sized to a first try
What the numbers say
On the 22 laggards the idea averaged −0.107R per trade after costs over 2100 trades, against 0.162 on today's winners. In bull markets it came to −0.111R and beat 0.0% of random-date draws; only bear markets were positive, at 0.097R. The winners' own rise, not the signal, seems to account for the gain there.
How it was tested
Buy at the close when on-balance volume sets a new 50-day high while the price has not yet set a 50-day high.
- 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
- 'Before the price' read as: OBV is at a 50-day high today while the close is below its own 50-day high, and price made no 50-day closing high in the prior 5 bars
- Price high measured on closing prices, not intraday highs
- OBV starts accumulating from the first available bar; only its 50-day relative level matters
- Stop is 2 x ATR(14) below entry; target is 4 x ATR(14) above entry (twice the risk)
- Time exit after 20 trading days if neither stop nor target is hit
- Signals while a trade is already open in the same stock are ignored
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 | 1,571 | −0.111R | −3.46 | −2.97 · 1,112d | −0.034R · beats 0% | +0.126R |
| Flat | 379 | −0.167R | −2.62 | −1.38 · 259d | −0.051R · beats 10% | +0.265R |
| Bear | 150 | +0.097R | 1.07 | 1.16 · 102d | +0.072R · beats 60% | +0.365R |
| All | 2,100 | −0.107R | −0.029R | +0.162R |
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.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
from scanners.base import Candidate
class ObvLeadsPriceLong:
name = "obv_50d_high_leads_price_long"
description = "OBV at a 50-day high while close is not at a 50-day closing high (and none in prior 5 bars)."
def __init__(self, lookback: int = 50, quiet_bars: int = 5, atr_period: int = 14,
stop_mult: float = 2.0, target_mult: float = 4.0) -> None:
self._lookback = lookback
self._quiet = quiet_bars
self._atr_period = atr_period
self._stop_mult = stop_mult
self._target_mult = target_mult
def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
n = self._lookback
need = max(n + self._quiet, self._atr_period + 1)
if len(bars) < need:
return None
closes = [b.close for b in bars]
obv = [0]
for i in range(1, len(bars)):
if closes[i] > closes[i - 1]:
obv.append(obv[-1] + bars[i].volume)
elif closes[i] < closes[i - 1]:
obv.append(obv[-1] - bars[i].volume)
else:
obv.append(obv[-1])
# OBV new 50-day high (strictly above prior 49 values)
if not obv[-1] > max(obv[-n:-1]):
return None
# Today's close is not the highest close of last 50 bars
if closes[-1] >= max(closes[-n:-1]):
return None
# No close at a 50-day closing high in the previous 5 bars
last = len(bars) - 1
for k in range(1, self._quiet + 1):
idx = last - k
window = closes[idx - n + 1: idx + 1]
if len(window) < n:
return None
if closes[idx] >= max(window):
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 or not (stop < entry < target):
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="OBV hit a 50-day high while price has not made a 50-day closing high (none in prior 5 bars): volume leading price.",
)
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.