Premier Stochastic Oscillator (PSO)

Calculate the Premier Stochastic Oscillator (PSO): the smoothed and normalised Stochastic %K squeezed between -1 and 1, which gives clearer overbought and oversold signals.

The Premier Stochastic Oscillator of Leibfarth (2008) rescales a short stochastic around zero, smooths it twice with an exponential average and squeezes the result between -1 and 1 with the inverse Fisher transform. The smoothing removes the noise of the stochastic and the transform keeps the oscillator near its extremes most of the time, so a reading that crosses back through 0.9 or -0.9 (or 0.2 and -0.2) stands out.

The formula is as follows:

\[\%K = \frac{100 \cdot (\text{Close} - \text{Lowest Low}(\text{window}))}{\text{Highest High}(\text{window}) - \text{Lowest Low}(\text{window})}\] \[\text{Normalized Stochastic} = 0.1 \cdot (\%K - 50)\] \[\text{Smoothed Stochastic} = \operatorname{EMA}(\operatorname{EMA}(\text{Normalized Stochastic},\; \text{smooth\_window}),\; \text{smooth\_window})\] \[\text{PSO} = \frac{\exp(\text{Smoothed Stochastic}) - 1}{\exp(\text{Smoothed Stochastic}) + 1}\]

Leibfarth uses an 8-period stochastic and a smoothing of 5 periods (the square root of 25).

Also known as: PSO, Premier Stochastic.

Example · AAPL, MSFT · 2024 to 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_premier_stochastic_oscillator:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["AAPL", "MSFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2024-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_premier_stochastic_oscillator()

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

How did the Premier Stochastic Oscillator of Apple and Microsoft move in 2025?

Which returns:

Parameters

get_premier_stochastic_oscillator accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe time period to consider for historical data. Options are: “intraday” (intraday prices), “daily” (daily prices), “weekly” (weekly prices), “monthly” (monthly prices), “quarterly” (quarterly prices), “yearly” (yearly prices). Defaults to “daily”."weekly"
close_columnstrThe column name for closing prices in the historical data. Defaults to “Adj Close”, in which case the high and low prices are adjusted for dividends in the same way."Close"
windowintThe number of periods of the high-low range of %K. Defaults to 8.20
smooth_windowintThe number of periods of each of the two EMAs. Defaults to 5.5
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 PSO. 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
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Leibfarth, L. (2008). “Premier Stochastic Oscillator.” Technical Analysis of Stocks & Commodities, 26(8).
  • Library Referenced against TA-Lib’s PSO
Share