Hi
On my live deployment, I keep getting the following error:
Runtime Error: The IBGateway soft restart timed out. Stack Trace: The IBGateway soft restart timed out.
That's all there is. Does anyone know what the cause might be?
Thank you
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.
IBGateway soft restart timed out. Seeking cause of 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
|
|
|||||||
|
|
||||||||
|
The IBGateway soft restart timed out
John Munro | Test123 | August 2023
Hi
On my live deployment, I keep getting the following error:
Runtime Error: The IBGateway soft restart timed out. Stack Trace: The IBGateway soft restart timed out.
That's all there is. Does anyone know what the cause might be?
Thank you
QuantConnectâ„¢ 2025. All Rights Reserved
Mia Alissi
The error message you're seeing, "Runtime Error: The IBGateway soft restart timed out", typically occurs when there's an issue with re-authenticating your Interactive Brokers (IB) account connection.
If your IB account has 2FA enabled, you receive a notification on your IB Key device every Sunday to re-authenticate the connection between IB and your live algorithm. If you don't re-authenticate before the timeout period, your algorithm quits executing.
You can set the time for these notifications in the "Weekly Restart UTC" field when deploying your algorithm. This is the Coordinated Universal Time (UTC) time of when you want to receive notifications on Sundays to re-authenticate your account connection.
For more information, you can refer to the QuantConnect documentation on Interactive Brokers and Getting Started with Live Trading.
If you continue to experience this issue, it might be worth checking your account settings on Interactive Brokers or reaching out to their support for further assistance.
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.
Andrew Czeizler
Hi all!
I am also getting errors when trying to backtest this algorithm.
Best,
Andrew
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.
Jing Wu
andrew_czeizler, this is an old post. Now we've already put "HistoricalReturnsAlphaModel" and "MeanVarianceOptimizationPortfolioConstructionModel" into the LEAN framework library. Please see the attached algorithm.
You'll find the model source code on Github
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.
Chadwick Adebiyi
I cloned the algo from above, and I went to run the backtest and I got a bunch of insufficient buying power errors. Any idea as to why this is happening? Below is an example of the errors I am seeing.
Backtest Handled Error: Order Error: id: 101, Insufficient buying power to complete order (Value:8129.9063), Reason: Id: 101, Initial Margin: 4065.9531329395, Free Margin: 1253.9592675246086301998343
Backtest Handled Error: Unable to compute order quantity of DBC. Reason: The portfolio does not have enough margin available.. Returning null.
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.
Jack Simonson
Lexx7,
To answer your questions in order:
1) The portfolio rebalances daily as it is, so if you only want to trade monthly, then you can add logic in the Alpha Model so that it only sends out signals when you want it to, i.e. in monthly intervals. You can see the backtest I've attached for an example in the HistoricalReturnsAlphaModel.py file.
2) Period refers to the number of periods (dependent on the data resolution) for which we want to examine prices, whereas lookback is the number of periods for which we want to examine returns. If you subscribe to daily data and ask the algorithm to rebalance the portfolio every day, it will try to look back for n-days of returns and use an n-day period of prices to find the optimal portfolio. Since you're subscribed to daily-data, this will result in an equal-weighted portfolio every time, and so the resolution of the data universe needs to be higher than that of the HistoricalReturnsAlphaModel.
3) Margin requirements get used up when the algorithm tries to take any position and so orders that require more capital than available will be canceled. You can find more information about margin accounts and other account types here.
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.
Alexandre Catarino
Hi all,
We have improved the base PortfolioConstructionModel and the algorithm shared by Jack is out-of-date.
Here is an updated version:
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!