Ultimate Oscillator
Larry Williams published the Ultimate Oscillator in 1985 to address a specific weakness of single-period momentum oscillators: a momentum reading calculated over just one lookback length can show a bullish or bearish divergence that only exists because of that one arbitrary period choice, and disappears on a slightly different length. Each bar's Buying Pressure is Close minus the true low (min(Low, prior Close)), and each bar's True Range is the true high (max(High, prior Close)) minus the true low - both figures already account for gaps against the prior close, not just the current bar's own high/low. These are summed separately over three different periods (default 7, 14 and 28 bars), each period's Buying-Pressure- sum divided by its True-Range-sum, and the three ratios combined with published weights of 4, 2 and 1 (heaviest on the shortest period), then multiplied by 100 and divided by 7 (the weight total) to land on a 0-100 scale. Because it blends three periods rather than reporting one, a genuine divergence has to hold up across short, medium and long lookbacks at once - the design Williams built it around. Notes and limitations - Requires InpSlowPeriod + 1 bars of history before it produces a value. - If the true range sum for any of the three periods is zero (a perfectly flat run of prices), that bar is left empty rather than dividing by zero. - This is an oscillator only - it does not detect or mark divergence, generate trade signals, or place alerts.
Indicator · MT4 · v1.0 · Free
About Ultimate Oscillator
Ultimate Oscillator is an indicator for MetaTrader 4. It has 3 settings, such as Fast period, Medium period and Slow period. MQL source code included.
Files in the download: UltimateOscillator.mq4, UltimateOscillator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Fast period | 7 | Shortest period (weight 4) |
| Medium period | 14 | Middle period (weight 2) |
| Slow period | 28 | Longest period (weight 1) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Divergence · Momentum · Oscillator · MT4 Indicator · MQL4 Source Code