Inertia

Calculate Dorsey’s Inertia: the Relative Volatility Index smoothed with a linear regression, which shows the direction of a trend, up above 50 and down below it.

Inertia is Dorsey’s Relative Volatility Index (RVI) smoothed with a linear regression: the end point of the least-squares line through the last 20 RVI values. Dorsey regarded a trend as momentum that persists, inertia, with its direction given by the direction of volatility, so Inertia above 50 marks an up trend and below 50 a down trend. The regression smooths the RVI with less lag than a moving average.

The formula is as follows:

\[\text{RVI} = \text{Relative Volatility Index}(\text{Close},\; \text{rvi\_window},\; \text{std\_window}),\;\; \text{or}\;\; \text{for the refined RVI} \;\frac{\operatorname{RVI}(\text{High}) + \operatorname{RVI}(\text{Low})}{2}\] \[\text{Inertia} = \text{Linear Regression}(\text{RVI},\; \text{window}),\;\; \text{the end point of the least-squares line}\]

with the RVI of get_relative_volatility_index (Wilder’s smoothing of the standard deviation on up and down periods) and the linear regression of get_linear_regression.

Also known as: INERTIA, Dorsey Inertia.

Example · AAPL, MSFT · 2024 to 2025

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

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_inertia()

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

Did Apple and Microsoft show upward or downward inertia in 2025?

Which returns:

Parameters

get_inertia 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”."Close"
windowintThe number of periods of the linear regression. Defaults to 20.20
rvi_windowintThe number of periods of Wilder’s smoothing in the RVI. Defaults to 14.14
std_windowintThe number of periods of the standard deviation in the RVI. Defaults to 10.10
methodstrThe Relative Volatility Index it uses. Options are: “original” (the RVI of the close), “refined” (the average of the RVI of the highs and of the lows; Dorsey, 1995). Defaults to “original”."original"
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 Inertia. 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 Dorsey, D. (1995). “Refining the Relative Volatility Index.” Technical Analysis of Stocks & Commodities, 13(9).
  • Paper Dorsey, D. (1993). “The Relative Volatility Index.” Technical Analysis of Stocks & Commodities, 11(6).
  • Library Referenced against pandas-ta-classic’s inertia
Share