-
Greetings! I'm currently developing a copy trading bot for a client. We have support for Tastytrade and would like to add IB as well. Now, as I'm reading up on the IB APIs and different options, I'm trying to figure out the best way to design the app. Originally I was looking at the web API, but it seems like any sessions created will be invalidated by a login elsewhere which is problematic as ideally the users could be logged in to the desktop platform and see trades coming in. Am I correct in assuming this wouldn't work? Assuming that's the case, we'd then need to consider using the TWS API. However, we'd be placing trades for around 300 users at once. Would we be able to route all of those trades through the same gateway without running into rate limits or other issues? I wasn't clear on the rate limit being per gateway or per user. Appreciate any help from the IB experts here. Thanks in advance! Graeme |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Yes, the single-account login is just an IBKR limitation. It's how they protect their market data agreements by only allowing one connection per account (sometimes you can play tricks with alternate users or sub accounts all attached to the same parent account). If you want users to see their account details while you are connected to their IBKR account, you would need to create a second custom dashboard for your users based on the internal trade details (either cached activity or your dashboard calls the IBKR API calls to fetch live data itself, etc). Other API brokers like Tradier are 100% REST based and don't require a gateway (yet, other API brokers also require a local gateway).
The IBKR gateway runs per account, so it all depends on how your accounts are setup. If each of your accounts are individual accounts you are running for other users, you would need 300 Java gateway processes (and they all require manual 2FA after user/pass login unless you ask IBKR to disable it on your account). If you have an advisor account and all the sub-accounts are just managed clients of your primary account, then you would only need one gateway connection and you would just manage all the sub-account details yourself about which accounts get which trades executed. As for rate limits, the official docs just say:
50 messages per second is 3,000 messages per minute, and it seems like enough for standard trading operations.
Also IBKR gets upset if you submit many orders which aren't executing. Their stated limit is you should remain under than 20 order calls (including modifications or cancels) per 1 executed order (so, just consider you start the day with 20 free order commands, then every executed order gives you an additional 20 order commands). Basically they don't want people submitting $0.01 limit buy orders on 1,000 symbols every day, so they expect orders to be "meaningful" and likely to execute. |
Beta Was this translation helpful? Give feedback.
Yes, the single-account login is just an IBKR limitation. It's how they protect their market data agreements by only allowing one connection per account (sometimes you can play tricks with alternate users or sub accounts all attached to the same parent account).
If you want users to see their account details while you are connected to their IBKR account, you would need to create a second custom dashboard for your users based on the internal trade details (either cached act…