The article “Interactive Brokers Live Algo Trading with QuantConnect” first appeared on AlgoTrading101 blog.
Table of contents:
- What is QuantConnect?
- What is Interactive Brokers?
- Why should I use Interactive Brokers with QuantConnect?
- Why shouldn’t I use Interactive Brokers with QuantConnect?
- Is hosting Interactive Brokers with QuantConnect free?
- What are some deployment alternatives?
- How to get started with Interactive Brokers and QuantConnect?
- How to deploy your trading bot on IBKR with QuantConnect?
- Learn more
What is QuantConnect?
QuantConnect is an online open-source financial system that allows its user to conduct research, perform analyses, create algorithmic trading bots, backtest strategies, optimize portfolios, and more.
Website: https://www.quantconnect.com
What is Interactive Brokers?
Interactive Brokers (IBKR) is an online brokerage that offers trading solutions for traders, investors, and advisors, with global access to stocks, options, futures, currencies, bonds, and funds.
Website: https://www.interactivebrokers.co.uk/en/home.php
Why should I use Interactive Brokers with QuantConnect?
- You might already have algorithms written inside QuantConnect.
- You can easily integrate the two technology software together.
- You don’t need to rewrite your QC strategies with ib_insync or similar.
- You don’t need to worry about the deployment process and server maintenance.
- You get all other benefits of QC such as backtesting.
Why shouldn’t I use Interactive Brokers with QuantConnect?
- You can self-deploy your solution for way cheaper.
- You get a greater sense of privacy.
- You don’t need to use the QuantConnect syntax and supported languages.
- You limit your risk and reliance on only one software solution.
- A self-hosted solution is much cheaper.
Is hosting Interactive Brokers with QuantConnect free?
Hosting Interactive Brokers with QuantConnect isn’t free. To host your bot, you will need to pay for a trading node. To have a trading node, you will need to pay a monthly fee to QuantConnect. All of this will add up to about $40.
What are some deployment alternatives?
A deployment alternative would be to deploy your own algorithm locally or by using a cloud provider such as AWS, GCP, Azure, etc.
How to get started with Interactive Brokers and QuantConnect?
To get started with Interactive Brokers and QuantConnect, you will need to have an account on both of them. To get an account with Interactive Brokers, please navigate to their main website and click the red “Open Account” button in the upper right part of the UI.
Then, follow through the steps and create an account. For live trading, you will need to verify your account and go through their onboarding experience which features various questions, KYC, and more.
To get an account with QuantConnect, navigate over to their landing page and click the “Sign in” button in the upper right corner of your screen. Then, click the “Sign up” button and follow through the process of linking up your email and creating a password.
Once both things are done, it will be important to know your username, user ID, and password or IBKR so that we can easily deploy an algorithm with QC as it will require our credentials.
How to deploy your trading bot on IBKR with QuantConnect?
To deploy your trading bot on IBKR with QuantConnect, you will need to ensure that you have a bot that works and a valid subscription for a live trading node. Also, make sure that you are logged out of IBKR and that TWS isn’t started on your machine.
Let’s begin by navigating to an algorithm that we will want to deploy and run on IBKR.
Press the thunderbolt icon inside your strategy UI to start the deployment process. This will open the Live Deploy Wizzard. When here, select IBKR. If you don’t have a subscription, it will show you a purple element that is linked to the place where you need to subscribe.
Let’s click it.
Here we can see that the minimum we need to deploy this will be the $10 per month subscription level. But that isn’t the only thing we need to actually deploy our trading bots. We will want a backtest node and a live compute node too.
When you click on the research tier option, it will take you to the checkout page and you will see several things being added to your monthly subscription. Those things are the Researcher seat, LiveNode, Backtesting Node, and Research node.
In total, this would cost you $60 per month or $600 for an annual subscription. To be honest, if you self-deploy it would cost you half or less of the price.
For deploying the bot, we don’t need a research node which is a Jupyter notebook environment, so we can save $12 from the monthly subscription and bring it down to $48 per month. If you want access to specific data, that comes at an extra cost.
To explore that, navigate to the Data section and you will see a list of available data sources that you might additionally need.
Once we get our subscription we can proceed through the UI and go back to our deployment wizard which will now have adequate fields for us to log into our IBKR account. Make sure that you aren’t running TWS and that you are not logged in to IBKR already.
Once you fill in your information and choose the type of IBKR account you want to use, you can click the deployment button which will perform the deployment process for you. There, you will be able to monitor your bot and also stop its execution if needed.
Learn more
To learn more about deploying a bot to IBKR on QuantConnect, I suggest exploring their deployment documentation which can be found on this link.
Join The Conversation
If you have a general question, it may already be covered in our FAQs. If you have an account-specific question or concern, please reach out to Client Services.
Leave a Reply
Disclosure: Interactive Brokers
Information posted on IBKR Campus that is provided by third-parties does NOT constitute a recommendation that you should contract for the services of that third party. Third-party participants who contribute to IBKR Campus are independent of Interactive Brokers and Interactive Brokers does not make any representations or warranties concerning the services offered, their past or future performance, or the accuracy of the information provided by the third party. Past performance is no guarantee of future results.
This material is from AlgoTrading101 and is being posted with its permission. The views expressed in this material are solely those of the author and/or AlgoTrading101 and Interactive Brokers is not endorsing or recommending any investment or trading discussed in the material. This material is not and should not be construed as an offer to buy or sell any security. It should not be construed as research or investment advice or a recommendation to buy, sell or hold any security or commodity. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.
Disclosure: API Examples Discussed
Throughout the lesson, please keep in mind that the examples discussed are purely for technical demonstration purposes, and do not constitute trading advice. Also, it is important to remember that placing trades in a paper account is recommended before any live trading.
Is Quantconnect saving my IBKR credentials? Which kind of API integration is used by Quantconnect? The Web API or the TWS API?
Hello, thank you for reaching out. QuantConnect integrates with Interactive Brokers using the TWS API over their customer LEAN Engine to the Trader Workstation. You can read more about the LEAN Engine system here: https://www.ibkrcampusdev.wpengine.com/campus/ibkr-quant-news/lean-engine-on-aws-and-interactive-brokers-guide/. As stated in the Quant Connect documentation, provided credentials are saved in their Lean Configuration File: https://www.quantconnect.com/docs/v2/lean-cli/datasets/brokerages#07-Research.
In the process of connecting Interactive Brokers to QuantConnect, you are providing your credentials to log in to their locally hosted IB Gateway system. These details were provided by Jared Broad, QuantConnect CEO, earlier this year as described in https://www.quantconnect.com/forum/discussion/16471/live-trading-with-ib/.
We hope this helps!