- er(close, length=None, drift=None, offset=None, **kwargs)[source]#
Efficiency Ratio (ER)
The Efficiency Ratio was invented by Perry J. Kaufman and presented in his book “New Trading Systems and Methods”. It is designed to account for market noise or volatility.
It is calculated by dividing the net change in price movement over N periods by the sum of the absolute net changes over the same N periods.
- Default Inputs:
ABS = Absolute Value EMA = Exponential Moving Average
abs_diff = ABS(close.diff(length)) volatility = ABS(close.diff(1)) ER = abs_diff / SUM(volatility, length)
close (pd.Series): Series of ‘close’s length (int): It’s period. Default: 1 offset (int): How many periods to offset the result. Default: 0
fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method
pd.Series: New feature generated.