I am currently trying to code a momentum stock trading algorithm. I also managed to get it working for a universe of 30 stocks. But as I increase the number of stocks to trade I get the following Error:

ValueError : all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 90 and the array at index 1 has size 2 

There is also no information about where (in which line) the error occurred. I attached the code. in the code I commented out a list called self.dji. If I use this list for my universe everything is working. Just when I increase the number of tradable stocks and use the list you can see in the code it stops working. My only explanation so far would be some sort of bug.

Looking forward for replies.

Kind regards 

Luca Würker

Author