Vortex Indicator (VI)

get_vortex(quotes, lookback_periods)


name type notes
quotes Iterable[Quote] Iterable of the Quote class or its sub-class.
See here for usage with pandas.DataFrame
lookback_periods int Number of periods (N) to consider. Must be greater than 1 and is usually between 14 and 30.

Historical quotes requirements

You must have at least N+1 periods of quotes to cover the warmup periods.

quotes is an Iterable[Quote] collection of historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.




name type notes
date datetime Date
pvi float, Optional Positive Vortex Indicator (VI+)
nvi float, Optional Negative Vortex Indicator (VI-)


See Utilities and Helpers for more information.


from stock_indicators import indicators

# This method is NOT a part of the library.
quotes = get_historical_quotes("SPY")

# Calculate 14-period VI
results = indicators.get_vortex(quotes, 14);

About Vortex Indicator (VI)

Created by Etienne Botes and Douglas Siepman, the Vortex Indicator is a measure of price directional movement. It includes positive and negative indicators, and is often used to identify trends and reversals. [Discuss] 💬