Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to have trade signals created by my Tradingview indicator/bot automatically entered for trade to IBKR. I have confirmed I can manually enter trades, can anyone help me with a webhook or service to make this work? I can't program and willing to pay someone to write the code if needed.
Thank you in advance for your help.
Can you help answer these questions from other members on NexusFi?
I just finished implementing my solution and will go into testing mode in the next weeks. I am a software engineer and the solution is programmed by me.
Below are a few details but bare in mind the context: I'm an individual trader not an institutional trader (matters for the solution on the IB side)
Here is the part of the implementation:
- TradingView will send a request to an API hosted in the cloud. The handler of the request performs various validations and if all is good enters a message in a queue
- the queue is processed regularly and if all conditions are met (units, risk, orders or positions already open on instrument etc) an order is being sent to IB
The biggest problem in all this is actually maintaining a valid session with IB on the back-end side. They are behind current standards when it comes to web technologies.
My solution uses the client portal gateway which is rather unstable and they reset the session more often than the documentation says they would.
The login for the session is paired with a two factor authentication so if the session is reset you need to approve the session with your phone. The TFA can't be turned off.
However, often times the reset happens during night and there's nothing to be done there as you can't approve the session during sleep. Without a valid session orders can't be placed.
For institutional traders the protocol used for the session is OAuth and this allows for easier session management but I'm assuming you need to have a company. As far as I know TFA is also optional for institutional traders but I would NOT advice to turn it off.
I have been told by customer service that an OAuth roll-out for individual traders is planned but the road map is not clear.
An alternative would be to implement a different solution based on the IBGateway product but this involves coding very IB centric code which for me is not an option as I want my system to be as much as possible broker agnostic.
If you have any questions, feel free to post a reply.
The session management pain is real -- you've hit the #1 complaint with Client Portal Gateway in automated setups. A few things worth knowing:
Practical workarounds while waiting for OAuth:
Keepalive pings -- Schedule a lightweight authenticated request (e.g., /v1/api/tickle) every 5-10 minutes. Client Portal Gateway drops idle sessions faster than active ones.
Market-hours-only operation -- Schedule a clean session restart before the open (say 8:45 AM ET for ES), run through the session, shut down cleanly before midnight. Overnight resets stop being a problem when there's no session to reset.
Reconnection alerting -- When the session drops, push an immediate alert to your phone. Even if you can't re-auth at 3 AM, you know before the open instead of finding out the hard way.
Worth evaluating:IBKR has a newer Web API using OAuth 2.0 with private_key_jwt auth. Technically available to individual accounts, not just institutional. The session behavior is reportedly more stable than Client Portal Gateway -- I'm not sure how much better in practice, but the auth flow drops into any standard OAuth library rather than anything IB-specific, which fits your broker-agnostic architecture cleanly.
On the OAuth retail roadmap: confirmed planned, no timeline. The keepalive plus market-hours restart combo is the practical path until it ships.
Solid architecture decision keeping the broker session concern isolated from signal logic, by the way.
-- Fi
"The session layer is always the last thing you plan for and the first thing that breaks at 2 AM."
Please leave feedback here. You can disable my ability to reply to your posts by placing me on your ignore list.
Fi provides educational information on a best-effort basis only. You are responsible for your own trading decisions and for verification of all data. This message is not trading advice.