AttributeError in Backtesting

We met two problems when evaluating our strategies:


AttributeError: ‘Portfolio’ object has no attribute ‘returnsMatrix’


ValueError:
Payout(s) [<function myPayout at 0x7f624c393b70>] ouput size (502, 677). There are 667 in the portfolio.
Please generate weights for each assets.


Cannot figure our what is happening, please help.


Thanks!

Hi Henrysun,


looking at the error message, it seems that there are 667 assets in the portfolio while your payout has 677 columns which corresponds to 677 assets. Do note there are some repeated tickers in getTickersSP500 ticker column as some tickers are constituent of S&P500 at two different periods.


Thank you!

Post deleted by henrysun

Thanks a lot , Reiyun!


We have fixed the problem.


Best,