Larry Williams built the Ultimate Oscillator in 1976 to fix a specific, well-known flaw in every single-period momentum oscillator: the answer you get depends entirely on the look-back you happened to choose. A 7-period reading and a 28-period reading of the same market can disagree completely, and a trader who only ever looks at one of them is making a hidden bet that their chosen period happens to match the market's current rhythm. The Ultimate Oscillator's answer is to stop choosing — it calculates the same buying-pressure ratio over three different periods at once and blends them into a single 0-100 line, weighted so the shortest period matters most and the longest still gets a vote.
How the Ultimate Oscillator Is Calculated
The building block is Buying Pressure: Close − min(Low, previous Close). That is, how far above the true low of the session price managed to close. The denominator is the familiar True Range: max(High, previous Close) − min(Low, previous Close) — the same measurement ATR averages. Buying pressure divided by true range answers "of the total ground covered this bar, how much of it did buyers hold onto by the close?"
Rather than averaging that ratio bar by bar, the Ultimate Oscillator sums each side separately over each period and then divides:
- Average7 =
Sum(BP, 7) / Sum(TR, 7) - Average14 =
Sum(BP, 14) / Sum(TR, 14) - Average28 =
Sum(BP, 28) / Sum(TR, 28) - UO =
100 × (4 × Average7 + 2 × Average14 + Average28) / 7
The 4:2:1 weighting is the design decision that makes the indicator work. The short period drives most of the movement so the line stays responsive, while the two longer periods act as a permanent drag that prevents a couple of unusual bars from throwing the reading to an extreme. Summing before dividing, rather than averaging bar-by-bar ratios, also means high-range bars naturally count more than quiet ones — a detail that quietly makes the indicator volatility-aware. Neither MetaTrader platform includes a built-in Ultimate Oscillator, so ultimate-oscillator-alert.mq4/.mq5 compute all four steps directly.
Entry Conditions
Because the UO is bounded 0-100, it uses overbought and oversold zones the same way RSI does — 70 and 30 by default. The signal this site's files alert on is not entering a zone but leaving it: a BUY when the line crosses back above 30 from below, and a SELL when it crosses back below 70 from above. Waiting for the exit matters more here than most traders expect. A market that has just pushed the UO under 30 is, by definition, one where sellers have been winning across all three look-back windows simultaneously — buying into that immediately is buying into demonstrated, broad-based selling pressure. The cross back out is the first evidence that the shortest of the three windows has actually turned.
Williams' Original Divergence Setup
Williams did not design the UO as a zone-crossing tool at all; he designed it around a specific three-part divergence setup, and it's still the strictest way to use it. For a buy: price makes a lower low while the UO makes a higher low; the UO's low during that divergence stays below 30; and then the UO breaks above the high it made between the two price lows. Only that third condition triggers the entry, with the stop below the second price low. The sell setup is the exact mirror. This is far more demanding than a simple cross of 30, which is why the ready-made alert files implement the cross and leave the full divergence read to your own eyes — but if you find the plain zone signal fires too often, Williams' version is where to look next.
Ultimate Oscillator vs RSI and Stochastic
All three are bounded momentum oscillators with the same 70/30 vocabulary, so the differences are easy to miss. RSI measures the ratio of average up-closes to average down-closes over one period — it cares only about close-to-close change and completely ignores where inside its range each bar traded. Stochastic does the opposite: it measures where the close sits inside the highest-high/lowest-low range of the period, ignoring how the market got there. The Ultimate Oscillator sits between the two — it uses the intrabar high and low like Stochastic, but frames them as buying pressure against true range, and it does the whole thing three times over. The practical consequence is that the UO produces noticeably fewer extreme readings than either. Stochastic will pin at 0 or 100 for long stretches in a trend; RSI will sit above 70 for days. The UO's long-period component drags it back toward the middle, so a genuine reading past 70 or below 30 is a rarer and more informative event.
Parameters
- FastPeriod / MiddlePeriod / SlowPeriod (defaults 7 / 14 / 28) — the three look-back windows. Williams' original values, and they hold up; the ratio between them (each roughly double the last) matters more than the absolute numbers. Doubling all three (14 / 28 / 56) produces a much slower line for higher-timeframe work.
- OversoldLevel / OverboughtLevel (defaults 30 / 70) — the zone boundaries the alert fires on when the line crosses back out. Widening to 25 / 75 makes signals rarer and more selective; narrowing to 35 / 65 fires more often.
- EnableAlert / EnablePush — toggle the on-screen popup and mobile push notification independently.
How Traders Combine the UO with Other Tools
The Ultimate Oscillator's weakness is that it says nothing about direction of trend, only about pressure, so its natural partners are tools that supply exactly that. A Moving Average or ADX reading used as a bias filter turns the UO from a two-way reversal signal into a one-way pullback signal — in an established uptrend, only the cross back above 30 is taken, and the cross below 70 is treated as information rather than a trade. That single change removes the most common way oscillators lose money, which is fading a strong trend over and over. Checking market structure before acting is the manual version of the same discipline: a UO cross back above 30 that happens at a prior support level inside an intact uptrend is a materially different trade from the identical cross happening mid-air during a breakdown.
A Word of Caution
The Ultimate Oscillator is smoother than its single-period relatives, but smoother is not the same as more accurate — the blend simply means it is slower to reach extremes and slower to leave them, which in a fast reversal makes it late. It is still an oscillator, which means it still has the defining oscillator failure mode: in a strong sustained trend, it can cross back out of oversold, generate a buy, and then watch price make a new low a week later, because "oversold" describes momentum, not value. Nothing about a reading under 30 says a market cannot go lower. Use it inside a trend or structure framework rather than as a standalone reversal system, and size positions on the assumption that a meaningful share of its signals will simply be early.
Download the Indicator
This custom indicator plots the Ultimate Oscillator in a separate window with 30/50/70 levels and alerts when the line crosses back out of the oversold or overbought zone. MT4 and MT5 versions are both included in the downloads below.