Hi,Mr.
Under the guidence of the Tutorial and your answers in the forums,we successfully created a payout function,but we met some new problems about the backtest function,as is shown below:
port = alphien.portfolio.Portfolio(tkr)
port.payout(payout,data)
port.evaluate()
port.backtest()
The payout funtion has a dataframe input which contains the ohlc data,and a weightmatrix output,just like the example you showed yesterday in other questions in the forums.But we cannot get the backtest function worked,the error is as follows:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-4df52dd42d2e> in <module>
1 port = alphien.portfolio.Portfolio(tkr)
2 port.payout(payout,data)
----> 3 port.evaluate()
4 port.backtest()/mnt/public/IT/Libs/Python/alphien/portfolio/portfolio.py in evaluate(self, startDate, endDate, zoom, period, lastN, computationDataPoints, rollEval, alignAndFillDates)
374 if rollEval is None:
375 self.singleEval(startDate=startDate, endDate=endDate, zoom=zoom, period=period, lastN=lastN, computationDataPoints=computationDataPoints,
–> 376 rollEval=False, alignAndFillDates=alignAndFillDates)
377 else:
378 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)
456 #align indicator with the underlying asset
457 if alignAndFillDates:
–> 458 weights = mergeAndFill(self.features.pxs, weights)
459
460 #remove leading NAsAttributeError: ‘NoneType’ object has no attribute ‘pxs’
Can you tell us what goes wrong and give us some more precise details of this Portfolio module?