Vortex Indicator
Calculate the Vortex Indicator for a given price series.
The Vortex Indicator quantifies the presence and strength of a directional trend by comparing each period’s price movement away from the prior period’s range to the period’s overall volatility (True Range). It consists of two lines, VI+ and VI-, whose crossovers signal potential trend changes: VI+ above VI- suggests an uptrend is in control, VI- above VI+ suggests a downtrend is in control.
The formula is as follows:
\[\text{VM} + = | \operatorname{High}(t) - \operatorname{Low}(t-1) |\] \[\text{VM} - = | \operatorname{Low}(t) - \operatorname{High}(t-1) |\] \[\text{VI} + = \operatorname{Sum}(\text{VM} +,\; \text{window}) / \operatorname{Sum}(\text{True Range},\; \text{window})\] \[\text{VI} - = \operatorname{Sum}(\text{VM} -,\; \text{window}) / \operatorname{Sum}(\text{True Range},\; \text{window})\]Also known as: VI, Vortex Indicator +/-, trend direction indicator.
Vortex Indicator in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_vortex_indicator as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
tickers=["AUDUSD"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.technicals.get_vortex_indicator().xs("AUDUSD", level=1, axis="columns").tail(5)
Or, after setting up the Finance Toolkit MCP, ask:
How did the positive and negative Vortex Indicator lines of the Australian dollar against the US dollar move against each other from 26 to 31 December 2025?
Which returns:
| Date | VI+ | VI- |
|---|---|---|
| 2025-12-26 | 1.1414 | 0.9189 |
| 2025-12-28 | 1.1667 | 0.8882 |
| 2025-12-29 | 1.1118 | 0.8882 |
| 2025-12-30 | 1.1094 | 0.8691 |
| 2025-12-31 | 1.058 | 0.9068 |
Parameters
get_vortex_indicator accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The time period to consider for historical data. Can be “intraday”, “daily”, “weekly”, “monthly”, “quarterly” or “yearly”. Defaults to “daily”. | "weekly" |
close_column | str | The 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" |
window | int | The number of periods to sum the directional movement and true range over. Defaults to 14. | 20 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the VI+ and VI- values. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |