Ultimate Oscillator

get_ultimate(quotes, short_periods=7, middle_periods=14, long_periods=28)

Parameters

name type notes
quotes Iterable[Quote] Iterable of the Quote class or its sub-class.
See here for usage with pandas.DataFrame
short_periods int, default 7 Number of periods (S) in the short lookback. Must be greater than 0.
middle_periods int, default 14 Number of periods (M) in the middle lookback. Must be greater than S.
long_periods int, default 28 Number of periods (L) in the long lookback. Must be greater than M.

Historical quotes requirements

You must have at least L+1 periods of quotes to cover the warmup periods.

quotes is an Iterable[Quote] collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.

Return

UltimateResults[UltimateResult]

UltimateResult

name type notes
date datetime Date
ultimate float, Optional Simple moving average

Utilities

See Utilities and Helpers for more information.

Example

from stock_indicators import indicators

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# calculate 20-period Ultimate
results = indicators.get_ultimate(quotes, 7, 14, 28)

About Ultimate Oscillator

Created by Larry Williams, the Ultimate Oscillator uses several lookback periods to weigh buying power against true range price to produce on oversold / overbought oscillator. [Discuss] 💬

image

Sources