Skip to content
The Casebook · A classic strategy

Ultimate Oscillator rises back above 30

Buy when the Ultimate Oscillator drops below 30 and then crosses back above 30.
VerdictTested Nov 22, 2026

Killed by costs

There is something there before trading costs; after them, too little is left to count (under 0.04R a trade).

  • +0.083R a trade before costs, +0.001R after the spread and the selection haircut.
Trades on the laggards
644

42 large US stocks, 15 years

Per trade, after costs
+0.001R

Before costs +0.083R

Bar to clear
t > 2.01

By trade and by day, sized to a first try

What the numbers say

Across 644 laggard trades the idea averaged +0.083R before costs but only +0.001R after costs, so the edge was spent on trading costs. In bull markets it was −0.036R, flat +0.024R, bear +0.145R, and no market's t value reached the 2.01 bar. Today's winners averaged +0.139R.

How it was tested

Buy at the close when the Ultimate Oscillator (7,14,28) closes back above 30 after having been below 30 on the prior day.

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
Choices made where the idea was open
  • Ultimate Oscillator uses the standard 7/14/28 periods with weights 4/2/1
  • 'Drops below 30 and then crosses back above 30' means the prior close is below 30 and the current close is at or above 30
  • Entry at the close of the day the cross occurs
  • No exit was named, so stop is 2 x ATR(14) and target is twice the risk
  • Time exit chosen as 20 trading days since none was given

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.

MarketTradesPer tradet, by tradet, by dayRandom datesWinners, per trade
Bull412−0.036R−0.58−1.13 · 316d−0.060R · beats 75%+0.127R
Flat152+0.024R0.220.22 · 95d−0.038R · beats 70%+0.280R
Bear80+0.145R1.080.63 · 41d+0.065R · beats 75%−0.027R
All644+0.001R−0.040R+0.139R

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.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 code
from decimal import Decimal

from core.domain import Bar
from strategies.indicators import atr
from scanners.base import Candidate


class UltimateOscillator30CrossBackUp:
    name = "ultimate_oscillator_30_cross_back_up"
    description = "Long when Ultimate Oscillator (7,14,28) crosses back up through 30"

    def __init__(self, p1: int = 7, p2: int = 14, p3: int = 28, level: float = 30.0,
                 stop_mult: float = 2.0, target_mult: float = 4.0) -> None:
        self._p1 = p1
        self._p2 = p2
        self._p3 = p3
        self._level = level
        self._stop_mult = stop_mult
        self._target_mult = target_mult

    def _uo(self, bars):
        n = len(bars)
        if n < self._p3 + 1:
            return None
        bps = []
        trs = []
        for i in range(n - self._p3, n):
            prev_close = bars[i - 1].close
            low = min(bars[i].low, prev_close)
            high = max(bars[i].high, prev_close)
            bps.append(bars[i].close - low)
            trs.append(high - low)

        def avg(p):
            tr_sum = sum(trs[-p:])
            if tr_sum <= 0:
                return None
            return float(sum(bps[-p:]) / tr_sum)

        a1 = avg(self._p1)
        a2 = avg(self._p2)
        a3 = avg(self._p3)
        if a1 is None or a2 is None or a3 is None:
            return None
        return 100.0 * (4.0 * a1 + 2.0 * a2 + 1.0 * a3) / 7.0

    def scan(self, ticker: str, bars: list[Bar]) -> Candidate | None:
        if len(bars) < max(self._p3 + 2, 16):
            return None
        uo_now = self._uo(bars)
        uo_prev = self._uo(bars[:-1])
        if uo_now is None or uo_prev is None:
            return None
        if not (uo_prev < self._level and uo_now >= self._level):
            return None

        atr_val = atr(bars, 14)
        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"Ultimate Oscillator crossed back above {self._level:g} (prev {uo_prev:.1f}, now {uo_now:.1f}).",
        )

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.

Have an idea of your own?

Describe it in plain words and get the same honest test in about a minute.

Run the Gauntlet
Ultimate Oscillator rises back above 30: Killed by costs · EdgeProven