I trying to set up a custom factor that is the distance between current price and 52 week high. Here is the code.
class HighPrice(CustomFactor):
window_length=252
outputs=["high"]
inputs=[USEquityPricing.close]
def compute(self, today, assets, out, close):
out.high[:] = (np.nanmax(close, axis=0) - close[-1]) / close[-1]
I get an error in the research note book
ValueError: unknown type record64