vortex#
- vortex(high, low, close, length=None, drift=None, offset=None, **kwargs)[source]#
Vortex
Two oscillators that capture positive and negative trend movement.
- Sources:
https://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:vortex_indicator
- Calculation:
- Default Inputs:
length=14, drift=1
TR = True Range SMA = Simple Moving Average tr = TR(high, low, close) tr_sum = tr.rolling(length).sum()
vmp = (high - low.shift(drift)).abs() vmn = (low - high.shift(drift)).abs()
VIP = vmp.rolling(length).sum() / tr_sum VIM = vmn.rolling(length).sum() / tr_sum
- Args:
high (pd.Series): Series of ‘high’s low (pd.Series): Series of ‘low’s close (pd.Series): Series of ‘close’s length (int): ROC 1 period. Default: 14 drift (int): The difference period. Default: 1 offset (int): How many periods to offset the result. Default: 0
- Kwargs:
fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method
- Returns:
pd.DataFrame: vip and vim columns