Hi,

I have written an algorithm that trades based on some history calls.

The algorithm works for most dates and number of stocks, however for some dates it only works under a certain amount of stocks.

I come to the conclusion that it is in history calls; that for some dates some stock don't have data.

I have tried to filter these stock out, but I failed.

Attached backtest fails when I use 9 securities or less but fails for 10 or more.

I have attached a backtest with 5 securities (variable self._numberofsymbols), the algorithm fails if I set this to 10 or more…

What goes wrong, and how to debug this?

Thanks for any help offered