Hi, pretty new to this, been trying ot read through the documents to see the correct way for connecting to the Interactive Brokers trading platform. I want to utilize the Interactive Brokers API, but I have been looking for an easier way to programatically connect to the API since normally I would need to utilize IB Gateway, but that requires user input, and I had been using IBController, which seems to have morphed into QuantConnect.
In short, I would like to connect to the Interactive Brokers API, send my requests for data, and or make trades, then close down the connection. Just not entirely sure how to go about doing it - using Visual Studio on Windows, and have downloaded and built LEAN.
Thanks
Jared Broad
We've created the IBAutomater for handling the reconnection system for IBGateway; you can see more about it here:Â
https://github.com/QuantConnect/IBAutomaterÂ
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.
Aaron Tawil
Would that include the handling of starting of IB Gateway, or will that still need some alternate input to start
Aaron Tawil
So that's actually what I'm trying to avoid. Basically, I want to have 2 services - one that runs once a day to open up a connection and download historical data, and one that opens a connection on demand when making a trade, but the trading one for now is optional, first I need to setup the historical data download.
I setup IBController running in a headless ubuntu docker container, which works, but it can only accept connections from the localhost. I was reading I need to find the ibg.xml file to setup allow ips, but was having issues finding the xml file, because it also is only created when you shutdown the gateway, and using docker compose it is basically being started fresh every time.
So right now trying to figure out the right way to go about it, and it seems like you have already done most of that with QuantConnect, but just starting out so a bit unfamiliar
Alethea Lin
Hi Aaron,
The IBAutomater supercedes the IBController. We suggest using the IBAutomater to start and stop the connection to Interactive Brokers via IBGateway. This blog explains more features of the IBAutomater, and you can automate your desired actions using the IBAutomater. Please check it out!
Thanks for your support!
Aaron Tawil
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!