Mass Index

Calculate the Mass Index for a given price series.

The Mass Index, developed by Donald Dorsey, looks for reversals in the width of the trading range rather than in price. It divides an EMA of the High - Low range by an EMA of that EMA, a ratio above 1 while the range widens and below 1 while it narrows, and sums the ratio over sum_window periods.

The formula is as follows:

\[\text{Single EMA} = \operatorname{EMA}(\text{High} - \text{Low},\; \text{ema\_window})\] \[\text{Double EMA} = \operatorname{EMA}(\text{Single EMA},\; \text{ema\_window})\] \[\text{Mass Index} = \operatorname{Sum}\left(\frac{\text{Single EMA}}{\text{Double EMA}},\; \sum_{window}\right)\]

With the default windows a range that neither widens nor narrows gives a Mass Index of 25. Dorsey’s “reversal bulge” is the index rising above 27 and then falling back below 26.5, after which the current trend is expected to reverse. The index does not say in which direction, so it is read together with a trend indicator such as a moving average. The ratio has no unit, so the level can be compared across stocks.

For more information, see the following sources:

Also known as: Mass Index, MI. See volatility_model.get_mass_index for the references.

Mass Index in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_mass_index as shown below.

from financetoolkit import Toolkit

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

toolkit.technicals.get_mass_index().tail(5)

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

How did the Mass Index of Amazon and Alphabet move from 24 to 31 December 2025?

Which returns:

Date AMZN GOOGL Benchmark
2025-12-24 23.5078 24.9252 24.0591
2025-12-26 23.285 24.4336 23.7267
2025-12-29 22.9215 23.8576 23.1418
2025-12-30 22.6104 23.4152 22.5802
2025-12-31 22.4079 23.0341 22.2524

Parameters

get_mass_index 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 close the high and low are taken on the basis of. Defaults to “Adj Close”, in which case the high and low prices are adjusted for dividends in the same way."Close"
ema_windowintThe number of periods of the single and double EMA. Defaults to 9, as defined by Dorsey.9, as defined by Dorsey
sum_windowintThe number of periods over which the EMA ratio is summed. Defaults to 25, as defined by Dorsey.25, as defined by Dorsey
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
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
Share