Ultimate oscillator
All indicators

LibraryMomentum

Indicator

Ultimate oscillator

Buying pressure against the true range over three lengths at once, weighted toward the shortest, on a scale from 0 to 100.

MomentumOwn pane3 inputsUO

How it is calculated

Buying pressure is the close minus the lower of the low and the previous close; the true range is the bar's range widened by any gap to the previous close. Both are summed over each of the three lengths, sorted from short to long, and the ratios weighted 4, 2 and 1. UO is 100 times the weighted sum divided by 7; a length whose range sum is zero adds nothing while the divisor stays 7. The first bar is not used. As TA-Lib ULTOSC, after Williams 1985.

Reference: TA-Lib ULTOSC (Williams 1985)

How to read it

Above 70 buying pressure dominated across the three lengths, below 30 selling pressure. Williams' own signal was a bullish divergence with the oscillator below 30, then the oscillator rising above the high it made between the two lows; a plain cross of 30 or 70 says less. With three lengths in one it is steadier than a single length oscillator but reaches the extremes less often.

In a strategy

A filter that allows longs only while buying pressure leads: ctx.ind("uo", fast=7, mid=14, slow=28) > 50, or an exit from a long once it rises above 70 and turns down.

Inputs

InputTypeDefaultRange or choices
Short lengthfastWhole number7min 1, max 5000
Medium lengthmidWhole number14min 1, max 5000
Long lengthslowWhole number28min 1, max 5000

What it draws

LineDrawn as
UOLine

Moves between 0 and 100. Guide lines at 30, 70.

Used in

No strategy template reads it yet.

OrionQuant