Calculate the Ultimate Oscillator for a given price series.

The Ultimate Oscillator is a momentum oscillator that combines short-term, mid-term, and long-term price momentum into a single value.

The formula is as follows:

\[\operatorname{Average}(i) = \operatorname{Sum}(\text{Buying Pressure},\; \text{window}_{i}) / \operatorname{Sum}(\text{True Range},\; \text{window}_{i})\] \[\text{Ultimate Oscillator} = 100 \cdot \left[(4 \cdot \text{Average}_{1}) + (2 \cdot \text{Average}_{2}) + \text{Average}_{3}\right] / 7\]

Also known as: UO, ultimate momentum oscillator. See momentum_model.get_ultimate_oscillator for the Buying Pressure and True Range definitions.

Ultimate Oscillator in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_ultimate_oscillator as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["^GDAXI"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_ultimate_oscillator().tail(5)

Or, after setting up the Finance Toolkit MCP, ask:

What did the Ultimate Oscillator of the DAX, which combines 7, 14 and 28-day buying pressure, show from 24 to 31 December 2025?

Which returns:

Date ^GDAXI Benchmark
2025-12-24 56.3876 57.6018
2025-12-26 60.8708 57.097
2025-12-29 69.7344 64.6179
2025-12-30 67.8468 66.1075
2025-12-31 nan 53.9197

Parameters

get_ultimate_oscillator accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”."weekly"
close_columnstrThe column in the historical data that represents Defaults to “Adj Close”, in which case the open, high and low prices are adjusted for dividends in the same way."Close"
window_1intThe number of periods for the first short-term window. Defaults to 7.5
window_2intThe number of periods for the second mid-term window. Defaults to 14.10
window_3intThe number of periods for the third long-term window. Defaults to 28.20
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the indicator values. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
Share