Hi,

I'm new to QC platform.

I want to incorporate my ML model saved as pkl file in backtesting and later live trading on quantconnect.

My first ptoblem is that I don't know how to calculate ta_lib indicators. I create simple example that does not work:

import pandas as pd import numpy as np from talib.abstract import ( DEMA, EMA, MIDPRICE, SMA, T3, TEMA, TRIMA, WMA, ADX, ADXR, AROONOSC, BOP, CMO, DX, MFI, MINUS_DM, MOM, ROC, RSI, TRIX , WILLR, ATR, NATR, BBANDS, AROON, STOCHRSI, HT_TRENDLINE, AD, OBV, HT_DCPERIOD, HT_DCPHASE, HT_TRENDMODE, TRANGE, AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE, ULTOSC, MAMA, SAR, SAREXT, APO, MACD, ADOSC, HT_PHASOR, HT_SINE, STOCHF, STOCH ) # GLOBALS periods = [5, 30, 60, 300, 480, 2400, 12000, 96000] class CalibratedResistanceAtmosphericScrubbers(QCAlgorithm): def Initialize(self): self.SetStartDate(2019, 12, 31) # Set Start Date self.SetCash(100000) # Set Strategy Cash self.AddEquity("SPY", Resolution.Minute) model = self.Download("https://github.com/MislavSag/trademl/blob/master/trademl/modeling/rf_model.pkl") def OnData(self, data): '''OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here. Arguments: data: Slice object keyed by symbol containing the stock data ''' open_ = self.Securities["SPY"].Open high_ = self.Securities["SPY"].High low_ = self.Securities["SPY"].Low close_ = self.Securities["SPY"].Close volume_ = self.Securities["SPY"].Volume dema = DEMA(np.array(close_), 30) self.Debug(f'DEMA value is equal to: {dema}')

If I ran this, it returns an error:

Runtime Error: TypeError : Argument 'real' has incorrect type (expected numpy.ndarray, got NoneType) at OnData in main.py:line 81 TypeError : Argument 'real' has incorrect type (expected numpy.ndarray, got NoneType)