I am new to both Quantopian and programming, I am trying to create a 'SigmaSpike' CustomFactor for screening purpose via pipeline where:
SigmaSpike = today's return / yesterday's stdev ( based on daily returns over a 20 day window)
Here is my code excerpt which gives the following error:
AttributeError: 'NoneType' object has no attribute 'domain'
class SigmaSpikes(CustomFactor): inputs = [USEquityPricing.close] window_length = 22 def compute(self, today, asset_ids, close): rturn = close.pct_change[1:] ytd_std = np.std(rturn[-2:], ddof = 1) out[:] = rturn[-1] / ytd_std
Would appreciate if I can be guided on this. Thanks in advance!