I want to filter stock that is in 30 days high in close price yesterday. Below are my code. However, it gets zero stock picked.
What's wrong with it?
class High(CustomFactor):
window_length = 31
inputs = [USEquityPricing.close]
def compute(self, today, asset_ids, out, close_prices):
range_max = np.max(close_prices, axis=0)
out[:] = close_prices[-1] - range_max
high_diff = High()
high_filter = high_diff == 0