I've created an algo that I'm quite happy with, but the problem is that when I'm trying to start my backtest. I have to limit my universe, which should be most stocks but at least 3,000 as the start takes forever to load and most often timeouts due to the 10 minutes limit. I've now had to cut it down to 500 stocks which is not really feasible as it'll only give me large cap universe. 

So I have a couple of questions.

- How can I log so I know which part of my code takes long to run and as such work on improving those bits?

- Can you override the 10 minute cap somehow? 

- Any feedback on my init as attached to this question would be useful. I have simplified it and don't really show what I do with the factors I load. Thinking I should collate a few of the for-loops to one for-loop. But not sure if that would make a huge difference, feels like a small change?

 

 

Author