Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to keep ib's client long-running? #307

Closed
wihoho opened this issue Aug 29, 2023 · 4 comments
Closed

How to keep ib's client long-running? #307

wihoho opened this issue Aug 29, 2023 · 4 comments
Labels
question Further information is requested

Comments

@wihoho
Copy link

wihoho commented Aug 29, 2023

Hi,

Thanks for this project. One issue I have is that the ib's desk client would be closing on its own from time to time. In that case, the crontab's docker command won't be useful as I will have to start ib's client before running this binary.

Any workaround?

@brndnmtthws brndnmtthws added the question Further information is requested label Aug 29, 2023
@brndnmtthws
Copy link
Owner

Unfortunately IBKR has made it very difficult to keep the client open, or to automate the login process. I believe the main reason they do this is that they don't want people exfiltrating the data, because the data is considered "intellectual property", i.e., an opportunity for them to collect your money.

This isn't unique to IBKR, pretty much all the brokers, exchanges, data brokers, and other 3rd party API tools use the same annoying tricks to prevent people from accessing and using the data.

This is likely the main reason they made their shitty second-factor auth so annoying, and now force everyone to use it.

It doesn't have to be this way, but it is because everyone is trying to squeeze everyone else for a few extra pennies. Perhaps one day someone with deep pockets will come along, buy the data wholesale (or buy an exchange perhaps), and liberate the data so we can have markets that aren't unfree and rigged in favour of the incumbents. More likely, however, is that we'll see bigger regulatory moats, more anti-competitive behaviour, and stricter and more hostile actions from the brokers.

So enjoy it while you still can, it will only continue to enshittify.

@noamagiv
Copy link
Contributor

noamagiv commented May 3, 2024

Hi, in add restart option so tws will automatically login. Manual authentication required once a week
See https://www.ibkrguides.com/traderworkstation/auto-restart-considerations.htm

Cheers

@brndnmtthws
Copy link
Owner

Hi, in add restart option so tws will automatically login. Manual authentication required once a week See https://www.ibkrguides.com/traderworkstation/auto-restart-considerations.htm

Cheers

FWIW, you can also run thetagang without starting the gateway (using the --without-ibc CLI flag) and have it simply connect to an existing TWS/gateway instance, if you prefer that. You just need to enable the API and use the correct host/port.

@brndnmtthws
Copy link
Owner

It turns out there's a way to workaround the 2FA issue for anyone else dealing with it.

You can create a second user account, provide the minimal trading permissions (i.e., disable withdrawals/transfers/management), enable the required data sources, and even set an IP restriction to limit access with those credentials. Just be sure to not enable 2FA when logging in with the second account. It's a bit annoying, but this way you can login with just a user/pass, and can reduce the damage surface area in case you lose your credentials (but just don't do that).

Repository owner locked and limited conversation to collaborators May 26, 2024
@brndnmtthws brndnmtthws converted this issue into discussion #433 May 26, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants