Stochastic Momentum Index (SMI)

Calculate the Stochastic Momentum Index (SMI): where the close lies relative to the middle of the high-low range of a window, smoothed, from -100 to 100.

The Stochastic Momentum Index of Blau (1993) measures where the close sits relative to the midpoint of the high-low range, rather than to its low as the stochastic does, and smooths both the distance and the range twice with an exponential average before dividing. It runs from -100 (a close on the low) to +100 (a close on the high) around zero, is less erratic than the stochastic, and is read with its signal line and the levels -40 and 40.

The formula is as follows:

\[\text{Distance} = \text{Close} - \frac{\text{Highest High}(\text{window}) + \text{Lowest Low}(\text{window})}{2}\] \[\text{Range} = \text{Highest High}(\text{window}) - \text{Lowest Low}(\text{window})\] \[\text{SMI} = \frac{100 \cdot \operatorname{EMA}(\operatorname{EMA}(\text{Distance},\; \text{long\_window}),\; \text{short\_window})}{0.5 \cdot \operatorname{EMA}(\operatorname{EMA}(\text{Range},\; \text{long\_window}),\; \text{short\_window})}\] \[\text{Signal Line} = \operatorname{EMA}(\text{SMI},\; \text{signal\_window})\]

Blau uses a 13-period range, smoothed over 25 and then 2 periods.

Also known as: SMI, Blau’s stochastic momentum.

Example · AAPL, MSFT · 2024 to 2025

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

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_stochastic_momentum_index().xs("AAPL", level=1, axis="columns")

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

How did the Stochastic Momentum Index of Apple and its signal line move in 2025?

Which returns:

Parameters

get_stochastic_momentum_index 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. Defaults to 13.20
long_windowintThe number of periods of the first EMA of the distance and the range. Defaults to 25.25
short_windowintThe number of periods of the second EMA. Defaults to 2.2
signal_windowintThe number of periods of the EMA of the SMI that gives the signal line. Defaults to 9.9
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 SMI and signal line. 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 Blau, W. (1993). “Stochastic Momentum.” Technical Analysis of Stocks & Commodities, 11(1).
  • Paper Blau, W. (1995). “Momentum, Direction, and Divergence.” Wiley.
  • Library Referenced against TA-Lib’s SMI
Share