Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Time limit for schedule function?

I understand why there should be a 50 second time limit for handle_data (since it's called every minute) but is there also supposed to be a time limit for a schedule_function? I have an algorithm that takes a few minutes to run (definitely less than 30 minutes) and I call the function using this algorithm every 30 minutes using the schedule_function but I'm receiving a time out exception. In this case do I have no choice but to change my algorithm or somehow optimise it? Thanks :)

2 responses

There's no way around the 50 second time out for handle_data or a scheduled function. If you can run your code outside of the trading day, you could try before_trading_start which has a 5 minute time out. Note, however, that the 5 minutes includes any pipeline computations (which are chunked, so the amount of time required will vary).

I see thanks!