Calculate the Percentage Price Oscillator (PPO) for a given price series.

The Percentage Price Oscillator (PPO) is a momentum oscillator that measures the difference between two moving averages as a percentage of the longer moving average.

The formula is as follows:

\[\text{PPO} = (\text{Short-term EMA} - \text{Long-term EMA}) / \text{Long-term EMA}\]

The PPO is the MACD line as a percentage of the long EMA, so unlike the MACD its level can be compared across stocks and over long periods. The usual signal line is the 9-period EMA of the PPO; it is not returned here and can be calculated from the result, for example with get_exponential_moving_average of the overlap_model.

Also known as: PPO, price oscillator.

Percentage Price Oscillator in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_percentage_price_oscillator as shown below.

from financetoolkit import Toolkit

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

toolkit.technicals.get_percentage_price_oscillator().tail(5)

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

How did the Percentage Price Oscillator of the Euro Stoxx 50 compare with that of the S&P 500 from 24 to 31 December 2025?

Which returns:

Date ^STOXX50E ^GSPC Benchmark
2025-12-24 0.0048 0.0043 0.0046
2025-12-26 0.0047 0.0049 0.0052
2025-12-29 0.0046 0.005 0.0054
2025-12-30 0.0051 0.005 0.0053
2025-12-31 0.0051 0.0043 0.0046

Parameters

get_percentage_price_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 the closing prices. Defaults to “Adj Close”."Close"
short_windowintThe number of periods for the short-term moving average. Defaults to 12, as for MACD.12
long_windowintThe number of periods for the long-term moving average. Defaults to 26, as for MACD.26
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