Back to Community
TimeoutException - Contest Entries Failing

Hello Q community.
My contest algos are getting kicked out of the contest due to timeout exceptions 5 days after they begin receiving a score.
Contest Entry Stopped - "TimeoutException: Too much time spent in handle_data and/or scheduled functions. 50 second limit exceeded.".
These errors are occurring from within functions like the one below and they don't occur at the same location of my code or within the same function for that matter. Also, these functions are successfully executing on the days prior to the failure, so I don't think it's my code that is crashing.
schedule_function(Basic_Materials1, date_rules.every_day(),time_rules.market_open(minutes=1))
In Quantopian's backtest environment each of these functions take between 24-38 seconds to execute over 1000's of observations.
Apparently, the contest environment runs differently than the backtest environment. I have no idea how though and therefore I'm not sure of how to compensate for the discrepancy.
Have you encountered this issue? Were you able to figure out why? Would you kindly share an approach you took to resolve this?
Any information might help.
Searching the Q forums shows other users encountering this same problem, but I'm not seeing a fix.
And, I can't toss my code into "before_trading_start", because it takes longer than 5 minutes to run.
Thank you

3 responses

Happens to me as well way too frequently. They don’t seem to be isolated incidents either but rather a symptom of some underlying problem. Is there a root cause analysis done so the appropriate preventive, detective, and corrective controls can be identified, prioritized, and implemented? I’d hope so but so far there’s no evidence of this, or we’re just intentionally kept in the dark for whatever reason. The only tactical circumventive measure that I’m aware of is to ask QSupport to recertify the strategy. Not very sustainable, strategic, or scalable unfortunately.

Looks like it's finally being addressed in this thread.

Edit: I've removed my negative comments that were a bit uncalled for. Sometime my frustration gets the best of me and overwhelms my rational self. Apologies! I'm very grateful for Q and appreciate that there will always be lots of challenges and not everything can be prioritized.

My contest entry failed a after a couple weeks due to a timeout in before_trading_start. It wasn't doing anything more complicated that day than it does on any other day.

We've recently implemented a fix that may help with some before_trading_start` timeout issues -- please see the original post here for more information.

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.