decay#
API documentation for pandas_ta.trend.decay Python function.
- decay(close, kind=None, length=None, mode=None, offset=None, **kwargs)[source]#
Decay
Creates a decay moving forward from prior signals like crosses. The default is “linear”. Exponential is optional as “exponential” or “exp”.
- Sources:
- Calculation:
- Default Inputs:
length=5, mode=None
- if mode == “exponential” or mode == “exp”:
max(close, close[-1] - exp(-length), 0)
- else:
max(close, close[-1] - (1 / length), 0)
- Args:
close (pd.Series): Series of ‘close’s length (int): It’s period. Default: 1 mode (str): If ‘exp’ then “exponential” decay. Default: ‘linear’ 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 generated.