true_range#

true_range(high, low, close, talib=None, drift=None, offset=None, **kwargs)[source]#

True Range

An method to expand a classical range (high minus low) to include possible gap scenarios.

Sources:

https://www.macroption.com/true-range/

Calculation:
Default Inputs:

drift=1

ABS = Absolute Value prev_close = close.shift(drift) TRUE_RANGE = ABS([high - low, high - prev_close, low - prev_close])

Args:

high (pd.Series): Series of ‘high’s low (pd.Series): Series of ‘low’s close (pd.Series): Series of ‘close’s talib (bool): If TA Lib is installed and talib is True, Returns the TA Lib

version. Default: True

drift (int): The shift 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.Series: New feature