I am trying to compute a custom factor using this class:
class EMA(CustomFactor):
inputs = [USEquityPricing.close]
window_length = 100
def compute(self, today, assets, out,vol):
out[:] = talib.EMA(vol, timeperiod=50)[-1]
However, I get the following error:
```
talib/func.pyx in talib.func.EMA (talib/func.c:63497)()
AssertionError: real has wrong dimensions
```
What am I doing wrong?
Also, I would like to call the class with a window length:
ema50 = EMA(mask=tradeable_stocks, window_length=50)
and then use the following class:
class EMA(CustomFactor):
inputs = [USEquityPricing.close]
def compute(self, today, assets, out,vol):
out[:] = talib.EMA(vol, timeperiod=window_length)[-1]
but it doesn't like it.