Relative Volatility Index (RVI)

Calculate Dorsey’s Relative Volatility Index (RVI): the standard deviation of the up periods against that of the down periods, from 0 to 100, which shows the direction of volatility.

The Relative Volatility Index is built like the Relative Strength Index, but measures the direction of volatility instead of the size of price changes: on a period that closes higher, the standard deviation of the last std_window closes counts as upward volatility, and on one that closes lower as downward volatility. Dorsey designed it to confirm other signals: buy signals when the RVI is above 50 and sell signals when it is below 50. The refined RVI averages the RVI of the highs and of the lows.

The formula is as follows:

\[\text{Up} = \operatorname{StdDev}(\text{Close},\; \text{std\_window}) \;\text{if the close rose},\;\; \text{else 0}\] \[\text{Down} = \operatorname{StdDev}(\text{Close},\; \text{std\_window}) \;\text{if the close fell},\;\; \text{else 0}\] \[\text{RVI} = \frac{100 \cdot \operatorname{Wilder}(\text{Up},\; \text{window})}{\operatorname{Wilder}(\text{Up},\; \text{window}) + \operatorname{Wilder}(\text{Down},\; \text{window})}\] \[\text{Refined RVI} = \frac{\text{RVI of the highs} + \text{RVI of the lows}}{2}\]

Wilder is Wilder’s smoothing, seeded with a simple average. The RVI runs from 0 to 100.

Also known as: RVI, RVIR, Relative Volatility Index. Not to be confused with the Relative Vigor Index (get_relative_vigor_index).

Example · JPM, GS · 2025

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

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["JPM", "GS"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_relative_volatility_index()

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

Was volatility in JPMorgan Chase and Goldman Sachs rising on up days or on down days in 2025, according to the Relative Volatility Index?

Which returns:

Parameters

get_relative_volatility_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 open, high and low prices are adjusted for dividends in the same way."Close"
windowintThe number of periods of Wilder’s smoothing. Defaults to 14, as defined by Dorsey.20
std_windowintThe number of periods of the standard deviation. Defaults to 10, as defined by Dorsey.10, as defined by Dorsey
methodstrOptions are: “original” (the RVI of the close; Dorsey, 1993), “refined” (the average of the RVI of the highs and 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 RVI. 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. (1993). “The Relative Volatility Index.” Technical Analysis of Stocks & Commodities, 11(6).
  • Paper Dorsey, D. (1995). “Refining the Relative Volatility Index.” Technical Analysis of Stocks & Commodities, 13(9).
  • Library Referenced against TA-Lib’s RVI
  • Library Referenced against TA-Lib’s RVIR
  • Library Shares similar logic as pandas-ta-classic’s rvi
Share