Calculate the Relative Vigor Index (RVI) for a given price series.

The Relative Vigor Index is an oscillator that measures the conviction of a current price trend using the relationship between closing and opening prices.

The formula is as follows:

\[\text{RVI} = \operatorname{Sum}(\text{Upward Close-Open Movement},\; \text{window}) / (\operatorname{Sum}(\text{Upward Close-Open Movement},\; \text{window}) + \operatorname{Sum}(\text{Downward Close-Open Movement},\; \text{window}))\]

Also known as: vigor index. Note this is a bounded [0, 1] measure of the proportion of upward close-open movement, related in spirit to (but not numerically the same as) John Ehlers’ published Relative Vigor Index. See momentum_model.get_relative_vigor_index for the full formula and caveats.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Relative Vigor Index for you. Just ask in plain English.

Calculate the Relative Vigor Index in Python

The Relative Vigor Index is available in the Technicals module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_relative_vigor_index as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT"])

toolkit.technicals.get_relative_vigor_index()

Which returns:

Date AAPL MSFT Benchmark
2026-06-18 0.4036 0.0663 0.4484
2026-06-22 0.4352 0.0626 0.3655
2026-06-23 0.2163 0.091 0.319
2026-06-24 0.2251 0.0984 0.3306
2026-06-25 0.1793 0.095 0.2203
2026-06-26 0.397 0.4174 0.2946
2026-06-29 0.4175 0.3712 0.4362
2026-06-30 0.7891 0.4475 0.6846
2026-07-01 0.7922 0.5237 0.9267
2026-07-02 1.1745 0.7045 0.5225

Parameters

get_relative_vigor_index accepts the following parameters:

  • period (str, optional): The time period to consider for historical data. Can be “daily”, “weekly”, “quarterly”, or “yearly”. Defaults to “daily”.
  • close_column (str, optional): The column in the historical data that represents the closing prices. Defaults to “Adj Close”.
  • window (int, optional): The number of periods for calculating the RVI. Defaults to 14.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to 4.
  • growth (bool, optional): Whether to calculate the growth of the indicator values. Defaults to False.
  • lag (int | list[int], optional): The lag to use for the growth calculation.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. Defaults to 1.

The Technicals module page introduces the module, and the sidebar lists all of its functions.

Share