Connect to Live and Paper Trading Simultaneously
By Dave Mabe
Interactive Brokers invited me to do a webinar on how I use the IBKR API.
I always leave time for questions, and there were lots of good ones from viewers.
We ran out of time to get to all of them, so I'll answer some of the better ones I didn't get to here over the coming days.
Multiple traders asked if there was support for paper trading in the IBKR API.
This highlights one of the nicest features of IBKR and their API.
First, every account comes with a paper trading account - check a box and one will automatically be created for you.
All the code you write to make trades is the same whether you're connected to live trading or paper trading.
The only difference is in the connection - when you want to connect to live trading, use port 7496, and when you want to connect to paper trading, use 7497.
Everything else stays the same.
But even that's not the most convenient part.
You can run two instances of Trader Workstation at the same time - one connected to your live account and one to your paper trading account.
But here's the rare feature they support in this configuration - both instances use the same real-time data feed when you run them on the same machine.
This allows you to test your automated strategy without risking any real money, right alongside live trades you might already be making.
This makes it trivial to test a speculative strategy.
The MabeKit Trade Client can run multiple instances simultaneously, each with its own separate configuration, log files, and context.
Traders use this flexibility in various ways, but a live/paper trading setup is popular.
-Dave
P.S. Have you ever made an order entry mistake that cost you money? Imagine never making a costly mistake again. Eliminate your trading mistakes with MabeKit.