tsi#

API documentation for pandas_ta.momentum.tsi Python function.

tsi(close, fast=None, slow=None, signal=None, scalar=None, mamode=None, drift=None, offset=None, **kwargs)[source]#

True Strength Index (TSI)

The True Strength Index is a momentum indicator used to identify short-term swings while in the direction of the trend as well as determining overbought and oversold conditions.

Sources:

https://www.investopedia.com/terms/t/tsi.asp

Calculation:
Default Inputs:

fast=13, slow=25, signal=13, scalar=100, drift=1

EMA = Exponential Moving Average diff = close.diff(drift)

slow_ema = EMA(diff, slow) fast_slow_ema = EMA(slow_ema, slow)

abs_diff_slow_ema = absolute_diff_ema = EMA(ABS(diff), slow) abema = abs_diff_fast_slow_ema = EMA(abs_diff_slow_ema, fast)

TSI = scalar * fast_slow_ema / abema Signal = EMA(TSI, signal)

Args:

close (pd.Series): Series of ‘close’s fast (int): The short period. Default: 13 slow (int): The long period. Default: 25 signal (int): The signal period. Default: 13 scalar (float): How much to magnify. Default: 100 mamode (str): Moving Average of TSI Signal Line.

See `help(ta.ma)`. Default: ‘ema’

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: tsi, signal.