This is what I get in the logs. Am I doing something wrong?
Runtime Error: System.Exception: Execution Security Error: Operation timed out - 19.6666666666667 minutes max
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Execution time exceeded 19.67 minute limit, causing a security error.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
Runtime Error: System.Exception: Execution Security Error: Operation timed out - 19.6666666666667 minutes max
Patrick Star | May 2017
This is what I get in the logs. Am I doing something wrong?
Runtime Error: System.Exception: Execution Security Error: Operation timed out - 19.6666666666667 minutes max
QuantConnectâ„¢ 2025. All Rights Reserved
Patrick Star
Sorry I should have added the stack trace. here it is:
842 | 14:30:28: Runtime Error: System.Exception: Execution Security Error: Operation timed out - 19.6666666666667 minutes max. Check for recursive loops. at QuantConnect.Isolator.ExecuteWithTimeLimit (System.TimeSpan timeSpan, System.Func`1[TResult] withinCustomLimits, System.Action codeBlock, System.Int64 memoryCap) [0x00290] in <2a4f50e5c9d54d7b86445ca48e409286>:0 at QuantConnect.Lean.Engine.Engine.Run (QuantConnect.Packets.AlgorithmNodePacket job, System.String assemblyPath) [0x00713] in <3feff023a6034110934d5d2c49a9e820>:0 (Open Stacktrace)
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Patrick Star
Another try caused the same exception with a different time out. This time 7.33333333333333 minutes:
394 | 01:00:26: Runtime Error: System.Exception: Execution Security Error: Operation timed out - 7.33333333333333 minutes max. Check for recursive loops. at QuantConnect.Isolator.ExecuteWithTimeLimit (System.TimeSpan timeSpan, System.Func`1[TResult] withinCustomLimits, System.Action codeBlock, System.Int64 memoryCap) [0x00290] in <2a4f50e5c9d54d7b86445ca48e409286>:0 at QuantConnect.Lean.Engine.Engine.Run (QuantConnect.Packets.AlgorithmNodePacket job, System.String assemblyPath) [0x00713] in <3feff023a6034110934d5d2c49a9e820>:0 (Open Stacktrace)
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Ray Bohac
If you post code it you will get better help otherwise we have to guess. Based on the error it is pointing to resource heave or infinite loops. Check on this first.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Patrick Star
The reason that I didn't post my code earlier was because this is not really a backtest. I am doing some data crunching in this code. I had emails with Jared and explained it to him. In one of his last emails he said the timeout seemed odd but this was on Friday. It's weekend right now and I didn't really expect an answer until everyone is back to work. So your reply is really appreciated.
I have nested loops but they are definitely not infinite. I used OnData to break down the loops and run smaller pieces of the calculations but still something is enforcing a timeout. I know that each loop takes only fractions of a second so the timeout must be on something else. I guess it's mostly a configuration somewhere and not related to the code.
I thought the timeout could be because that I'm not doing any trades in the loop. So then I added a buy on each loop to show some trades but still it's timing out.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Patrick Star
Output logs:
https://www.quantconnect.com/backtests/31984/568199/ce03b79f9653dcdbcbf1e55b0e2d712c-log.txt
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Jared Broad
Limits on backtests are calculated by looking at the number and type of
subscriptions and estimating a maximum which is a realistic non error case.
If you want more help share a backtest or code snippet.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Patrick Star
Hi Jared,
Thanks for the reply. I posted the code a little earlier (it doesn't have a chart though). I understand the problem but don't know how to overcome the timeout limitation.
Thanks!
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Jared Broad
Hi Patrick. You're spending 20 minutes backtesting a 10 minute window - I'm sure you can see the problem here :). You may want to investigate increasing the program speed. You can also try making a much longer time period as the time allocated is proportional to the backtest length.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!