Any help would be greatly appreciated. I believe I need to modify the OBV data to pass it through the LINEARREG and LINEARREG_SLOPE functions?... I am getting this error:
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got numpy.float64)
There was a runtime error on line 73.
Code below:
def record_OBV(context, data):
hist_price = data.history(context.spy, 'price', 200, '1d')
hist_volume = data.history(context.spy, 'volume', 200, '1d')
obv = talib.OBV(hist_price, hist_volume)[-1]
log.info(obv)
obv_trendline = talib.LINEARREG(obv, timeperiod=28)[-1]
obv_slope = talib.LINEARREG_SLOPE(obv, timeperiod=28)[-1]
record(OBV = obv, OBV_Trendline = obv_trendline, OBV_Slope = obv_slope)