Hi,
I am trying to test the MonmentumSP500Select in Python, but experience a error as shown below.
code:
tkr = alphien.data.getTickersSP500().ticker
port = alphien.portfolio.Portfolio(tkr)
data = alphien.data.getHistoryData(tkr, field = ‘bb_live’, zoom=‘2007::2016’)
port.payout(alphien.tutorial.momentumSP500Select,features = data,n=32)
port.evaluate(zoom=“2007::2016”)
port.backtest()
error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-20-6fe72d4328ac> in <module>
3 data = alphien.data.getHistoryData(tkr, field = ‘bb_live’, zoom=‘2007::2016’)
4 port.payout(alphien.tutorial.momentumSP500Select,features = data,n=32)
----> 5 port.evaluate(zoom=“2007::2016”)
6 port.backtest()
7/mnt/public/IT/Libs/Python/alphien/portfolio/portfolio.py in evaluate(self, startDate, endDate, zoom, period, lastN, computationDataPoints, rollEval, alignAndFillDates)
397 if rollEval is None:
398 self.singleEval(startDate=startDate, endDate=endDate, zoom=zoom, period=period, lastN=lastN, computationDataPoints=computationDataPoints,
–> 399 rollEval=False, alignAndFillDates=alignAndFillDates)
400 else:
401 self.rollEval(startDate=startDate, endDate=endDate, zoom=zoom, period=period, rollingWindow=rollEval, computationDataPoints=computationDataPoints)/mnt/public/IT/Libs/Python/alphien/portfolio/portfolio.py in singleEval(self, startDate, endDate, zoom, period, lastN, computationDataPoints, rollEval, alignAndFillDates, composeLogic)
448 if self.payoutDataParamName[i] in self.payoutParams[1][i]:
449 # data arg keyword is present but value is None -> replace with data features
–> 450 if self.payoutParams[1][i][self.payoutDataParamName] is None:
451 loadFromFeatures = ‘keyword’
452 # case user passed in argument as positional argumentTypeError: unhashable type: ‘list’
Thanks,