ULTOSC
ULTOSC
Summary
Ultimate Oscillator: momentum indicator combining buying-pressure/true-range ratios over three time periods into one 0-100 weighted average. Blends short-, medium-, and long-term momentum to damp single-period noise. Ranges 0-100; conventionally >70 overbought, <30 oversold.
Formula
trueLow = min(low, prevClose); BP = close - trueLow
TR = max(high-low, |prevClose-high|, |prevClose-low|)
avg_n = (sum BP over n bars) / (sum TR over n bars)
ULTOSC = 100 * (4avg_short + 2avg_mid + avg_long) / 7
Notes
- The three periods are sorted internally, so the 4/2/1 weighting always applies to the shortest, middle, and longest period regardless of the order in which you pass them.
Inputs
inHigh— High price of each barinLow— Low price of each barinClose— Close price of each bar
Outputs
outReal— Ultimate Oscillator value
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod1 | integer | 7 | 1–100000 | Bars for one averaging window |
optInTimePeriod2 | integer | 14 | 1–100000 | Bars for another averaging window |
optInTimePeriod3 | integer | 28 | 1–100000 | Bars for another averaging window |
Properties
Numerical Stability: Start-Independent
| Display Flags |
|---|
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
Implementation
TA-Lib Definition: ultosc.c · ultosc.yaml
| Native | File |
|---|---|
| C | ta_ULTOSC.c |
| Rust | ultosc.rs |
| Java | Core_ULTOSC.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Ultimate Oscillator, UO
See Also
References
- Larry Williams, The Ultimate Oscillator, Technical Analysis of Stocks & Commodities, V.3:4 (1985)