Auto-Trading multiple IB accounts


#1

This question may be slightly off-topic. It involves not only AmiBroker but also Windows, TWS, and Interactive Brokers features.

What are some recommendations and pitfalls to avoid when auto-trading multiple accounts with Interactive Brokers? Two of the accounts will trade the same strategy. The third account will trade a different strategy. Is there a recommended architecture?

If this is already documented somewhere, I would be happy to find and read the docs.


#2

Hi Steve

The first thing you’ll need to do is set up an Advisor account in IB and assign all the accounts you want to trade to the Advisor account. You’ll then login to TWS with the Advisor account credentials, and you’ll then have access to trade all the client accounts.

If you want to send an order for just a single account, in the IB Controller you can either use SetAccount() to set the account before sending the order, or you can just set the account inside the PlaceOrder() command.

For trading the same strategy on multiple accounts use the FA Setup in TWS to create an account group or allocation profile and send the order to that grouping using the PlaceOrder() command.

It’s all well documented in the IB Controller Help. Search the page for “advisor”.

image

image


#3

@HelixTrader Thank you for the prompt reply. To follow-up, may I ask what software architecture would be needed if I do not use the advisor account structure? Would that require running 3 instances of TWS?


#4

I’m not sure that’s going to help you Steve since the IBC can only connect to one instance of TWS. If you wanted to do it that way, my guess is you would need 3 separate machines, or VPSs, running separate instances of TWS and Amibroker. However, as I use the Advisor method that’s only a guess. Maybe someone else can jump in and say whether it’s possible to control multiple TWS instances on the same machine.


#5

As @HelixTrader wrote you need Advisor or Friends&Family account (they are similar). If you want to trade multiple individual accounts instead you would need to run 3 instances of TWS and 3 instances of AmIBroker each connected to other TWS (via different port numbers or better on different computers - can use virtual machine for example) or using 3 different Windows User accounts (as each user has “own” processes and “own” OLE automation).


#6

Thank you @HelixTrader and @Tomasz.

My apologies for continuing this slightly off-topic thread, but one more consideration is the IB data feed. How does the Friends and Family account affect the number of allowed streaming symbols and monthly fees for the data feed?


#7

It operates just like any other regular account. If you trade client accounts through the Advisor account, rather than directly through logging on to the client accounts themselves, you can turn off all the data feeds for the client accounts, and just have data turned on for the Advisor account. So in that way, it can reduce your data costs.

Depending on how you have the Advisor account set up will determine whether they classify you as an individual or as a professional, and therefore how you are charged for the data.


#8

Perfect. Thank you @HelixTrader