Auto-Trade with Interactive Brokers

Nov 4, 2021 by Cone

3 Steps to Auto-Trade with Interactive Brokers

What is Auto-Trading?

Auto-trading is the practice of allowing a set of programmed rules fully or partially control your brokerage trading. Successful active trading relies on using a strategy that has a high probability of a positive return given a statistically large number of trading opportunities. Auto-trading, or using a "trading bot" (as if "robot" needs an abbreviation) reduces a trader's workload by making decisions with real-time market data and automatically placing orders with a broker. Auto-trading greatly reduces a trader's workload, doesn't miss opportunities, and places orders with a minimal amount of delay - and without error.





Step 1 - Build a Trading Strategy

A trading strategy is a set of rules that determines when to enter and exit the market. Rules can be based on anything that you can program such as a relationship between price and its moving average, an overbought/oversold indicator like a Relative Strength Index (RSI), words in a news headline, or even the phases of the moon!

When you boil it all down, it's essential for a trading strategy to have these 3 elements:

  1. Entry rule(s) - when to get in
  2. Exit rule(s) - when to get out for a profit or loss
  3. Position sizing rule(s) - how much capital to use for a trade. Also known as money management.

Each of the rules can be as simple or complex as you want to make it, and the KISS Principle often works well in trading. Nonetheless, seasoned traders will take into account many other factors, like optimizing their choice of indicator parameter values or adding logic for handling too many trade candidates when buying power is limited.

Step 2 - Backtest your Strategy

It's really a matter of due diligence. Would you risk money on a strategy that you knew was a bad idea? No one knows for sure if a trading strategy will work in the future, but you can find out if it would have worked in the past. Understanding that no period in the future will be precisely like it was before, backtesting is quick way to show that your strategy had worked using real historical market data.

A backtest uses real historical market data to feed a backtesting engine on a bar-by-bar basis and creating [hypothetical] trades as if the strategy were actually trading at that time. When a backtest uses real-world portfolio rules for buying power and trading costs, it's also called a trading simulation.

Backtesting gives you insight about what you can expect when you trade a strategy. For example, an equity curve shows how the value of an account would have grown. We're also able to use hypothetical trading results to calculate any number of metrics. Just to name a few: Annual Percent Return, Average Profit Percent per trade, Maximum Drawdown amount, or the number of days it could take to make a new equity high following a period of drawdown. If you find that the backtest results don't match your trading goals or risk profile, it could be time to revisit Step 1 until you find a strategy that does!

Step 3 - Connect Wealth-Lab to Interactive Brokers

Now that you have a strategy that backtesting has given you confidence to trade, it's time to connect to a broker! If you're not ready to put real money to work, consider Paper Trading. You can create a free no-obligation account at Alpaca and use the same techniques demonstrated here to trade a simulated account.

To connect to Interactive Brokers for trading, you must start IB Gateway or Trader WorkStation (TWS). You should also have installed the TWS API software from IB's website as well as the Interactive Brokers Extension for Wealth-Lab.

Depending on the type of strategy, the trading interval, and the number of symbols in your watchlist, you need the right tool for the job. To trade a handful of symbols, you can run your strategy from individual chart windows. If you're trading an end-of-day stop/limit order strategy like the dip buyer shown in the video above, the Quotes tool monitors and triggers stop/limit orders when they become marketable during the day.

But when you need real-time scanning for intraday strategies that execute on large watchlists like the Nasdaq 100, S&P 100, or S&P 500, then you'll need Wealth-Lab's Strategy Monitor to collect and crunch the data in a matter of seconds to generate and automatically send trading signals to your broker. Managing a task of that size would quickly overwhelm any trader and would be impossible without auto-trading!

What's the cost to Auto-Trade at Interactive Brokers?

There is no cost to Auto-Trade strategies with a Wealth-Lab 7 subscription. Create and auto-trade as many strategies as you like. Wealth-Lab's Premium Annual Plan comes in at $33.33/month, which is less than the fee some sites charge for auto-trading a single strategy! In addition to that savings, Wealth-Lab takes full advantage of brokers' APIs to access historical and streaming data, also for no extra fees.

Conclusion

Trading is a difficult business, and you should treat it like business by doing research, taking risks or reducing risk when it makes sense. Following a mechanical trading strategy that you designed and understand how it works can keep you on the path to reach your financial goals by taking programmed actions when opportunities present themselves. Because trading even just a handful of positions simultaneously can be overwhelming, auto-trading is recommended to reduce a trader's workload, stress, and emotional involvement that could lead to bad trading decisions at precisely the wrong time.