Back to Community
Error: Execution Timeout

I have a basic strategy that I have been working on for a while now. Today when I try to build it or run a backtest it reports Error: Execution Timeout. It is a simple algorithm and should not timeout. Has anything changed today?

31 responses

It is probably because your handle data function is taking too long to execute

ExecutionTimeout
Cause:Request took too long to execute. Possible messages include HandleDataTimeoutException, InitializeTimoutException, TimeoutException, ExecutionTimeout.
Solution:
Optimize your code to use faster functions. For example, use history() instead of batch_transform().
Use a smaller universe of stocks. Every security you include in the algorithm increases memory and CPU requirements of the algorithm.
Backtest over a small time period.

Not really. To test if that is the case, I removed all code from handle_data and it still times out.

Here is the basic skeleton that times out.

def initialize(context):
set_symbol_lookup_date('2015-01-01')
context.symbols =symbols('BHP','BBL','RIO','VALE','MON','DD','ABX','FCX','GG')
context.SPY = sid(8554)
schedule_function(func=handle_data, date_rule=date_rules.week_start(),time_rule=time_rules.market_open(hours=0,minutes=5))

def handle_data(context, data):
pass

It's happening to all my algorithms. Has anyone faced similar issue?

Okay. It must be happening to everyone. I just created a new account and ran a dummy algorithm. Same issue. I guess Quantopian is down.

Found it. Importing this library causes it to timeout.

from sklearn.decomposition import PCA

These sorts of things appear to happen every now and then. I don't think there is any straightforward fix on our side. I'm sure speeding up the algorithm is always a useful thing but I think you've got to just wait and try again.
https://www.quantopian.com/posts/error-execution-timeout
https://www.quantopian.com/posts/execution-timeout

Thanks for reporting it. I also hit 'Execution timeout' often and without that import.

The timeout is ~5 seconds and repeated tries will sometimes succeed.
The timeout goes away if I start carving away sections of my code or by removing some symbols.
It is not any specific code because I can toggle below and above the threshold by merely removing some comments and adding them back in.
Once upon a time I was able to run all of these sets of ~200 symbols each without ever seeing that timeout (it was a tremendous load on the server).
Currently I would be curious to know whether anyone can run any single entire set of those without seeing the timeout (note time has passed and some of those symbols are now off market, the IDE will let you know, just remove those individually, also use set_symbol_lookup_date('2015-02-03') -ish).

Other than that, if you are hampered by 'Execution timeout' and willing to add your note here, I think the higher number of messages from all of you letting them know will be the only impetus that could bring Q to want to spend time taking a look and to maybe try doubling that to 10 or something.

I'm also experiencing timeouts on code that was otherwise running fine yesterday.

I am also experiencing time-outs in all my programs, they were running fine yesterday

Same here. For an algo that worked yesterday the backtest runs half of the time and timeouts the other half.

I must have clicked "Build Algorithm"like a hundred times now but no luck. It immediately reports Error: Timeout. I will wait for the Quantopian support to come online and hopefully they will fix it.

Sometimes an execution timeout means the code is too long; sometimes it means that we have a backtest capacity issue. I don't think you're hitting that. I think we have intermittent bug related to a database upgrade we did that is making the search for an available backtest server fail.

We're working on it. I apologize for the inconvenience and frustration. I very much want to fix this as soon as possible.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks for your prompt response Dan.

Same here. I am able to run the "Build Algorithm" command and simulation would be fine; but "Run Full Backtest" will fail with that "Execution Timeout" error. Though an issue I reported about fundamental data seems have been fixed.

Same issue here, couldn't import ib module and had the timeout error

I'm also seeing the same issue with a very basic algorithm.

I tried backtesting an algorithm that is already live trading; same error.

Had a problem with my algo, I know it works.

Things I've noticed:

Algo works in live mode.
Algo breaks during build.
Algo seemed to work for a bit with a log-out quantopian - log-in quantopian

Hi all,

Thanks to those of you who posted here in the thread and reached out to us via email. We're aware of the execution timeouts on the site and are actively working to fix the issue. As Dan mentioned, they're stemming from a platform upgrade we preformed earlier, and not from your algorithm code. Our dev team is working on a patch.

I realize this hinders your backtesting and I'm really sorry for the inconvenience. We'll post an update as soon as we have more information.

Thanks,
Alisa

Edit: You can monitor the site status here: http://status.quantopian.com/

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks Alisa, Im sure we all appreciate it. Although this gives me an opportunity to do actual work at work.

We've implemented a quick-fix that resolves the worst of the problem - backtests are now running for all customers. There is still a performance issue where backtests take about 5 seconds longer to initialize than they should. We are working to put in a larger fix as soon as we can.

Interestingly enough, I'm now getting an error in the following import: "from brokers.ib import IBExchange" when starting a back test. Error states "Runtime exception: ImportError: No module named ib". Could this be related to your tuning/fixes?

There are various comments about 'code being too long'. Are there implied or hard limits on the size of code allowed to be built and tested? Is there a server/cloud resource limit on each account?

@Beat, we noticed this too and are working to fix the import ib module error. It's on its way!

@Mark, the size limit for algorithms is about 500,000 characters, or about 5,000 lines of code.

"Execution timeout" has been gone since around the start of February.

Today it is back again as of around 5p eastern time (Sunday). Anyone else seeing that?

I'm getting repetitive execution timeouts, 'someone' is taking up CPU space, need more system capacity or the ability to subscribe to 'dedicated' server space. Maybe Quantopian is back testing all the new contest entries?

Update : Repetitive execution time outs consistently between 10 to 15 seconds. I'm on the west coast. Code operations were fine up to 5 PM Eastern. It would help to have some comment from Quantopian about their system status.

Gary and Mark,

I'm in the process of increasing the amount of time that backtests have to start-up before the system thinks they expired. The change should be live across our backtest servers shortly (and is actually live on some of them already).

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I'm back up and running, thanks for the status comment!