I made this indicator to screen stocks by a ratio of the range in their open/close values and high/low values. Stocks that have small daily returns (open to close) but a high range (daily low to daily high) will return a low ARR value approaching zero. Stocks with larger daily returns and a smaller range will return a higher ARR value approaching one. The notebook I prepared uses this indicator in the quantopian pipeline to screen for low ARR stocks. If anyone finds this useful or interesting, feel free to use it and improve it!
class AverageRangeRatio(CustomFactor):
inputs = [USEquityPricing.close, USEquityPricing.open, USEquityPricing.high, USEquityPricing.low]
def compute(self, today, assets, out, close, open, high, low):
spread = high - low
avg_spread = np.nanmean(spread, axis=0)
daily_move = close - open
abs_daily_move = np.absolute(daily_move)
avg_abs_daily_move = np.nanmean(abs_daily_move, axis=0)
out[:] = avg_abs_daily_move / avg_spread