I'm trying to start local LEAN instance with IBKR paper account. And I got this in logs:
20221007 23:10:12.155 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): IBAutomater process started - Id:153 - Name:IBAutomater.sh - InitializationTimeout:00:15:00
20221007 23:10:12.159 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
20221007 23:10:12.161 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 1 0 57 5673507 370496 1 23:10 pts/0 00:00:03 dotnet QuantConnect.Lean.Launcher.dll
20221007 23:10:12.161 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 153 1 0 2379 2856 3 23:10 pts/0 00:00:00 /bin/bash /Lean/Launcher/bin/Debug/IBAutomater.sh /root/ibgateway
20221007 23:10:12.162 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 154 153 0 2844 2804 0 23:10 pts/0 00:00:00 ps -AFH
20221007 23:10:13.635 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:15.640 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:17.187 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): UID PID PPID C SZ RSS PSR STIME TTY TIME CMD
20221007 23:10:17.192 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 1 0 32 5673507 371164 1 23:10 pts/0 00:00:03 dotnet QuantConnect.Lean.Launcher.dll
20221007 23:10:17.194 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 153 1 0 2379 3000 3 23:10 pts/0 00:00:00 /bin/bash /Lean/Launcher/bin/Debug/IBAutomater.sh /root/ibgateway
20221007 23:10:17.196 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): root 158 153 0 2844 2812 1 23:10 pts/0 00:00:00 ps -AFH
20221007 23:10:17.648 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:18.158 TRACE:: InteractiveBrokersBrokerage.OnIbAutomaterOutputDataReceived(): IBGateway started
20221007 23:10:19.658 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:21.681 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:23.704 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:25.723 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:27.740 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:29.770 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:31.802 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
20221007 23:10:33.827 DEBUG:: LiveTradingResultHandler.Update(): Algorithm not yet initialized.
It looks like the Initialize method has never been called.
def Initialize(self):
self.Log("Initialize +++++++++++++++++++++++++++++++")
self.SetStartDate(2022, 9, 24)
self.SetEndDate(2022, 10, 25)
self.SetCash(10000)
What could it be?
I run it in --verbose mode and still don't understand IBGateway status. Is it connected?
I tried to use a wrong password — same result, no errors “IBGateway started”, “Algorithm not yet initialized”.
Gregory
It looks like ibgateway doesn't work. I tried to start it inside the container and nothing happened, no output.
Derek Melchin
Hi Gregory,
We were unable to reproduce this issue. Did you follow these steps?
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
Gregory
Is there any successful experience of using this setup with M1 processor?
A had some issues with IB Gateway + Docker + MacOS + M1 before. I suspect this is the case.
Gregory
The same configuration is working fine on Linux machine.
Most likely the issue was with IB Gateway not working on Linux container with Apple M1 host machine.
Is there a simple way to bypass IBAutomater?
I tried to pass "ib-host": "host.docker.internal", but it tries to start IBAutomater anyway (and it doesn't work).
It would be nice to be able to use TWS/IB-gateway on a host machine instead. Not only to resolve this M1 issue. TWS is a good tool for observing orders created by LEAN.
Alexandre Catarino
Hi Gregory ,
We recommend Lean CLI for local deployment.
There is no way to bypass IBAutomater, or to connect to TWS on a host machine.
When QuantConnect/Lean logs into IB Gateway, we cannot log in to TWS since IB doesn't allow multiple connections. Additionally, Lean cannot connect to a TWS instance if we are already logged in, so we can't use TWS to observe orders created by Lean.
Best regards,
Alex
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
Gregory
Yes, I use Lean CLI.
That was my point. If I was able to use “external” TWS/Gateway (they are the same thing from API perspective), I could observe orders real-time, connect multiple algorithms at the same time, and trade manually on the same IB account.
As far as I know, IB allows a second user in the account. But every next user has to pass all KYC procedures. And each user must have a IBKey devise (not sure if it is possible to share one 2FA device for many users). So it would be difficult to run three algorithms at the same time in the current architecture.
Rich McPharlin
Adding my +1 here.
Live deployment on IBKR runs fine on my AWS box, but never appears to launch IBGateway on my M1 Pro in the docker container.
Derek Melchin
Hi Rich,
Subscribe to GitHub Issue #212 to track the progress of issues between the M1 chip and the CLI.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
Rich McPharlin
Thanks Derek,
In reference to that Issue, I'm able to run simple backtests on my M1 Pro, yet to do anything more complex while I sort out datasets. It just seems to be the launching of IBGateway that is the issue. Let me know if you want logs.
Rich
Gregory
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!