indicator · own pane · open source

Ultimate Oscillator

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Ultimate Oscillator blends buying pressure across 7, 14 and 28 bar windows with weights 4:2:1. Resolves the single-window divergence problems of plain RSI/Stochastic.

  • Above 70 = overbought, below 30 = oversold.
  • Bullish divergence below 30 is a high-conviction long trigger.
  • Adjust the three lengths for asset volatility.

Source code

//@version=5
indicator("Ultimate Oscillator", overlay=false)
l1 = input.int(7, "Fast Length", minval=2, maxval=50)
l2 = input.int(14, "Mid Length", minval=2, maxval=100)
l3 = input.int(28, "Slow Length", minval=2, maxval=200)
bp = close - math.min(low, close[1])
tr_ = math.max(high, close[1]) - math.min(low, close[1])
avg1 = math.sum(bp, l1) / math.sum(tr_, l1)
avg2 = math.sum(bp, l2) / math.sum(tr_, l2)
avg3 = math.sum(bp, l3) / math.sum(tr_, l3)
uo = 100.0 * (4.0 * avg1 + 2.0 * avg2 + avg3) / 7.0
hline(70, "Overbought", color=color.gray, linestyle=hline.style_dashed)
hline(30, "Oversold", color=color.gray, linestyle=hline.style_dashed)
p_UO = plot(uo, "UO", color=color.olive, linewidth=2)
alertcondition(ta.crossunder(uo, 30), "UO oversold", "Ultimate Oscillator crossed below oversold")
alertcondition(ta.crossover(uo, 70), "UO overbought", "Ultimate Oscillator crossed above overbought")

Comments

No comments yet.

Sign in to comment.