¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Starting TWS live and paper simultaneously

 

Creating a separate log-file folder for the papersession solved the problem.

Thanks again!!


Re: Starting TWS live and paper simultaneously

 

¿ªÔÆÌåÓý

Yes this still works if it¡¯s set up right. In particular you need to makes sure that logfile folders are different for the two instances.

?

Attach the logfiles for both IBC instances, so I can see what¡¯s going on (NB:? I want the IBC log files, not TWS).

?

From: [email protected] <[email protected]> On Behalf Of Despair
Sent: Sunday, June 9, 2024 7:31 PM
To: [email protected]
Subject: [ibc] Starting TWS live and paper simultaneously

?

There was a time when I could start two instances of the TWS (one in paper mode and one for live trading) simultaneously with IBC without problems. At some point this stopped working.?

When I have start my live session and then try to start the additional paper session the IBC window just opens and closes quickly. Can this still be done somehow?


Re: Starting TWS live and paper simultaneously

 

Yes. I do this. It¡¯s explained in the user guide. Look towards the end in the section ¡°Multiple IBC Instances.¡±


Starting TWS live and paper simultaneously

 

There was a time when I could start two instances of the TWS (one in paper mode and one for live trading) simultaneously with IBC without problems. At some point this stopped working.?

When I have start my live session and then try to start the additional paper session the IBC window just opens and closes quickly. Can this still be done somehow?


Re: How to turn off 2FA

 

¿ªÔÆÌåÓý

Robert

?

The item I was referring to in the User Guide? is under ¡®NOTES REGARDING AUTO-RESTART IN TWS/GATEWAY 1018 and later versions¡¯ on the first page.

?

Maybe you aren¡¯t familiar with the Auto-Restart mechanism in Gateway and TWS? This is precisely a means to login once at the start of the week, and Gateway/TWS will then automatically restart each day and re-login (not requiring 2FA) using cryptographically secured data generated just before the restart. I suggest you read the relevant IBKR documentation (I can¡¯t give you a link for that offhand, but I¡¯m sure you¡¯ll be able to find it).

?

My personal preference has always been for Windows (at least, since Windows NT 4 was released). I¡¯ve never been a fan of Unix or Linux, in spite of being a user of Solaris back in the late 80s).

?

Regarding the GUI, if you¡¯re running Gateway it¡¯s probably irrelevant since there¡¯s not much you can do with it once you¡¯ve got things configured properly (and that usually means no configuration at all since Gateway works quite well ¡®out-of-the-box¡¯ with IBC). However you¡¯ll still need XVFB since Gateway does actually have a GUI so there needs to be something there to absorb the X protocol stuff it generates.

?

If you¡¯re wanting to run large numbers of Gateway instances concurrently, Linux would be much cheaper. You can ¡®Dockerize¡¯ IBC to greatly reduce resource consumption (IBC does not provide an ¡®official¡¯ Docker image, but there are quite a few floating around if you look for them, and they would be a good starting point for creating your own).

?

Regarding ¡®partnering up¡¯, I simply don¡¯t have time for taking on anything like this. You are of course free to use IBC in any way you like (compliant with its GPL licence), and it shouldn¡¯t be too difficult to incorporate its scripts into your infrastructure. But if IBC ends up helping your business and you want to send a slice of your profits to me, I¡¯d be happy to receive them: but as is usually the case with open source software, nobody else does (except for a handful of private users): my total financial benefit over 21 years of IBC development is probably far less than $500.

?

If you want to discuss this any further, please email me directly as this isn¡¯t really on-topic for this group.

?

Richard

?

?

?

From: [email protected] <[email protected]> On Behalf Of Robert Grzesik
Sent: Tuesday, June 4, 2024 7:34 PM
To: [email protected]
Subject: Re: [ibc] How to turn off 2FA

?

This is super helpful, thank you very much! I really appreciate your efforts on IBC, it really seems like a great product and can¡¯t wait to get it set up.?

?

I¡¯m also the lead developer of lumibot (over 700 github stars) and the CEO of lumiwealth (a community of over 30k Algo traders). Maybe we can partner up somehow? I¡¯d be happy to promote IBC and maybe we can add native support to lumibot. We are also a for profit entity so we can pay you for sending us traffic.?

?

As for your responses:

?

1. Can you point me to where exactly you mention this? Maybe I¡¯m blind but I can¡¯t find it.?

?

2. This is awesome, can¡¯t wait to set up IBC.?

?

3. Love these suggestions. Which do you prefer, Windows or Linux? I¡¯ve never had to run a GUI in either one. I¡¯m assuming Linux would be much cheaper??

?

Also any thoughts on doing this without a GUI? I¡¯m just thinking if we wanted to automate this process for 1000+ accounts it could get tricky.?


Robert, CEO Lumiwealth
347-635-3416

?

?

On Tue, Jun 4, 2024 at 12:22?PM Richard L King via <rlking=[email protected]> wrote:

FYI, I¡¯m the developer of IBC, so yes, I¡¯m quite knowledgeable about it¡­

?

Answers to your questions:

?

  1. You need to study the User Guide! The very first page mentions Auto-Restart. Also read the section on Second Factor Authentication.
  2. If you run Gateway without using IBC, you only get the alert on your phone once: if you don¡¯t acknowledge it within 3 minutes, login fails and you have to interact directly with Gateway to login again: but IBC does that for you.
  3. Running it on a cloud server is really no different from running it on your own computer, especially if it¡¯s a Windows server, except for the following:

¡¤?????? For Windows:

  1. You¡¯ll need to enable Remote Desktop if you want to be able to interact with the GUI
  2. You¡¯ll need to set up a VPN tunnel to give you secure access to the GUI and the API port. I recommend WireGuard, which I use myself to access my home systems when I¡¯m away from home.

?

¡¤?????? For Linux:

  1. You¡¯ll need to install a virtual frame buffer like XVFB, or something like VNC server, to enable you to access the GUI (using a VNC client)
  2. You can use an SSH tunnel to secure things.
  3. You might find this document helpful: It¡¯s quite old now, and relates more to TWS than Gateway, but it contains a mass of useful information if you¡¯re not a Linux expert

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of rob@...
Sent: Tuesday, June 4, 2024 2:01 PM
To: [email protected]
Subject: Re: [ibc] How to turn off 2FA

?

That sounds great. Yea I guess you're right that we don't have to be in front of a computer now that I think about it.

A few follow up questions since you seem very knowledgable on this issue:

1. You say we only have to log in once a week, how do you accomplish that? From what I can tell IB Gateway forces you to log in every 24 hours.

2. When you say "If you forget, it will keep sending the prompt periodically until you do it.", do you mean that when using IBC? Or is that something that Gateway does automatically?

3. Any ideas how to run this all in the cloud? Running it on my computer seems easy enough, but running it on a server like AWS or Heroku seems a lot more complicated. Any advice or resources on this?

Thank you so much Richard!


Re: How to turn off 2FA

 

This is super helpful, thank you very much! I really appreciate your efforts on IBC, it really seems like a great product and can¡¯t wait to get it set up.?

I¡¯m also the lead developer of lumibot (over 700 github stars) and the CEO of lumiwealth (a community of over 30k Algo traders). Maybe we can partner up somehow? I¡¯d be happy to promote IBC and maybe we can add native support to lumibot. We are also a for profit entity so we can pay you for sending us traffic.?

As for your responses:

1. Can you point me to where exactly you mention this? Maybe I¡¯m blind but I can¡¯t find it.?

2. This is awesome, can¡¯t wait to set up IBC.?

3. Love these suggestions. Which do you prefer, Windows or Linux? I¡¯ve never had to run a GUI in either one. I¡¯m assuming Linux would be much cheaper??

Also any thoughts on doing this without a GUI? I¡¯m just thinking if we wanted to automate this process for 1000+ accounts it could get tricky.?

Robert, CEO Lumiwealth
347-635-3416


On Tue, Jun 4, 2024 at 12:22?PM Richard L King via <rlking=[email protected]> wrote:

FYI, I¡¯m the developer of IBC, so yes, I¡¯m quite knowledgeable about it¡­

?

Answers to your questions:

?

  1. You need to study the User Guide! The very first page mentions Auto-Restart. Also read the section on Second Factor Authentication.
  2. If you run Gateway without using IBC, you only get the alert on your phone once: if you don¡¯t acknowledge it within 3 minutes, login fails and you have to interact directly with Gateway to login again: but IBC does that for you.
  3. Running it on a cloud server is really no different from running it on your own computer, especially if it¡¯s a Windows server, except for the following:
  • For Windows:
  1. You¡¯ll need to enable Remote Desktop if you want to be able to interact with the GUI
  2. You¡¯ll need to set up a VPN tunnel to give you secure access to the GUI and the API port. I recommend WireGuard, which I use myself to access my home systems when I¡¯m away from home.

?

  • For Linux:
  1. You¡¯ll need to install a virtual frame buffer like XVFB, or something like VNC server, to enable you to access the GUI (using a VNC client)
  2. You can use an SSH tunnel to secure things.
  3. You might find this document helpful: It¡¯s quite old now, and relates more to TWS than Gateway, but it contains a mass of useful information if you¡¯re not a Linux expert

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of rob@...
Sent: Tuesday, June 4, 2024 2:01 PM
To: [email protected]
Subject: Re: [ibc] How to turn off 2FA

?

That sounds great. Yea I guess you're right that we don't have to be in front of a computer now that I think about it.

A few follow up questions since you seem very knowledgable on this issue:

1. You say we only have to log in once a week, how do you accomplish that? From what I can tell IB Gateway forces you to log in every 24 hours.

2. When you say "If you forget, it will keep sending the prompt periodically until you do it.", do you mean that when using IBC? Or is that something that Gateway does automatically?

3. Any ideas how to run this all in the cloud? Running it on my computer seems easy enough, but running it on a server like AWS or Heroku seems a lot more complicated. Any advice or resources on this?

Thank you so much Richard!


Re: How to turn off 2FA

 

¿ªÔÆÌåÓý

FYI, I¡¯m the developer of IBC, so yes, I¡¯m quite knowledgeable about it¡­

?

Answers to your questions:

?

  1. You need to study the User Guide! The very first page mentions Auto-Restart. Also read the section on Second Factor Authentication.
  2. If you run Gateway without using IBC, you only get the alert on your phone once: if you don¡¯t acknowledge it within 3 minutes, login fails and you have to interact directly with Gateway to login again: but IBC does that for you.
  3. Running it on a cloud server is really no different from running it on your own computer, especially if it¡¯s a Windows server, except for the following:
  • For Windows:
  1. You¡¯ll need to enable Remote Desktop if you want to be able to interact with the GUI
  2. You¡¯ll need to set up a VPN tunnel to give you secure access to the GUI and the API port. I recommend WireGuard, which I use myself to access my home systems when I¡¯m away from home.

?

  • For Linux:
  1. You¡¯ll need to install a virtual frame buffer like XVFB, or something like VNC server, to enable you to access the GUI (using a VNC client)
  2. You can use an SSH tunnel to secure things.
  3. You might find this document helpful: It¡¯s quite old now, and relates more to TWS than Gateway, but it contains a mass of useful information if you¡¯re not a Linux expert

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of rob@...
Sent: Tuesday, June 4, 2024 2:01 PM
To: [email protected]
Subject: Re: [ibc] How to turn off 2FA

?

That sounds great. Yea I guess you're right that we don't have to be in front of a computer now that I think about it.

A few follow up questions since you seem very knowledgable on this issue:

1. You say we only have to log in once a week, how do you accomplish that? From what I can tell IB Gateway forces you to log in every 24 hours.

2. When you say "If you forget, it will keep sending the prompt periodically until you do it.", do you mean that when using IBC? Or is that something that Gateway does automatically?

3. Any ideas how to run this all in the cloud? Running it on my computer seems easy enough, but running it on a server like AWS or Heroku seems a lot more complicated. Any advice or resources on this?

Thank you so much Richard!


Re: How to turn off 2FA

 

That sounds great. Yea I guess you're right that we don't have to be in front of a computer now that I think about it.

A few follow up questions since you seem very knowledgable on this issue:

1. You say we only have to log in once a week, how do you accomplish that? From what I can tell IB Gateway forces you to log in every 24 hours.

2. When you say "If you forget, it will keep sending the prompt periodically until you do it.", do you mean that when using IBC? Or is that something that Gateway does automatically?

3. Any ideas how to run this all in the cloud? Running it on my computer seems easy enough, but running it on a server like AWS or Heroku seems a lot more complicated. Any advice or resources on this?

Thank you so much Richard!


How to run gateway for one week at a time

 

I heard that IB Gateway only needs to log in once per week, but I can't find the settings anywhere to accomplish that. Any ideas how to set up IB Gateway so that it doesn't log out every day, and instead I only have to log in once per week?


Re: How to turn off 2FA

 

¿ªÔÆÌåÓý

2FA has been mandatory on live IBKR accounts for a couple of years now. There is no way to avoid it. That¡¯s why IBC goes to such lengths to make it as simple as possible.

?

It really could hardly be easier. Once a week you have to turn on your phone and acknowledge the login prompt from IBKR. If you forget, it will keep sending the prompt periodically until you do it. You don¡¯t even need to be anywhere near your computer: anywhere where your phone is with you (and has internet access via mobile data or wifi) will be fine.

?

Your documentation quote is way out of date. I suggest you read the latest User Guide at . A PDF version is also available at , and it is included in the installation zip file for each release.

?

Richard

?

?

From: [email protected] <[email protected]> On Behalf Of rob@...
Sent: Tuesday, June 4, 2024 5:59 AM
To: [email protected]
Subject: [ibc] How to turn off 2FA

?

Hey, I am trying to get a trading algorithm to work with IB Gateway but keep running into the issue that I need to use 2FA through my phone to log in. I'm sure you guys already know about this issue really well, is there some sort of solution?

I found this in the IBC docs but can't seem to find this setting anywhere:

Please note that IBC cannot automatically complete your login if Interactive Brokers have given you a card or device that you must use during login. IBC can still enter your username and password, but you will have to type in the relevant code, or use the IBKR Mobile app to complete the login. You can request Interactive Brokers (via your Account Management page on their website) to relax this requirement when logging in to TWS or Gateway, but you will lose certain guarantees should you suffer losses as a result of your account being compromised.

Any ideas?


How to turn off 2FA

 

Hey, I am trying to get a trading algorithm to work with IB Gateway but keep running into the issue that I need to use 2FA through my phone to log in. I'm sure you guys already know about this issue really well, is there some sort of solution?

I found this in the IBC docs but can't seem to find this setting anywhere:
Please note that IBC cannot automatically complete your login if Interactive Brokers have given you a card or device that you must use during login. IBC can still enter your username and password, but you will have to type in the relevant code, or use the IBKR Mobile app to complete the login. You can request Interactive Brokers (via your Account Management page on their website) to relax this requirement when logging in to TWS or Gateway, but you will lose certain guarantees should you suffer losses as a result of your account being compromised.
Any ideas?


Re: Strange problem

 

... So log in doesn't proceed until you enter them manually.?

I'll consider if I can improve IBC 's behaviour in this (very unusual) situation.?

But what you need to do is to delete the autorestart file, which you'll find at :

C:\Jts\geaphcidk...\autorestart?

Then run IBC again and all should be well.?



From: [email protected] <[email protected]> on behalf of Richard L King <rlking@...>
Sent: Tuesday, May 28, 2024 9:09:42 am
To: [email protected] <[email protected]>
Subject: Re: [ibc] Strange problem

Thanks for the file. I understand what's going on now.?

When TWS auto-restarts it creates a file called 'autorestart' which contains the credentials from the previous session. The new instance uses this to re-establish the security context so you don't need to log in again. Normally this file only exists for a couple of seconds because autorestart happens very quickly. It's actually quite difficult to force a situation where this file exists long term, but that's what has happened here.?

So when you run IBC, it detects the file and passes it to TWS, like any normal autorestart situation. However the credentials expire after some time, and in that case TWS just starts the normal full log in dialogue, which is what you're seeing. Because it thinks autorestart is happening, IBC ignores the login dialog and doesn't enter the user I'd and password?



From: [email protected] <[email protected]> on behalf of Despair <boris@...>
Sent: Monday, May 27, 2024 10:58:47 pm
To: [email protected] <[email protected]>
Subject: Re: [ibc] Strange problem

Thank you very much. Here is the log file.


Re: Strange problem

 

Thanks for the file. I understand what's going on now.?

When TWS auto-restarts it creates a file called 'autorestart' which contains the credentials from the previous session. The new instance uses this to re-establish the security context so you don't need to log in again. Normally this file only exists for a couple of seconds because autorestart happens very quickly. It's actually quite difficult to force a situation where this file exists long term, but that's what has happened here.?

So when you run IBC, it detects the file and passes it to TWS, like any normal autorestart situation. However the credentials expire after some time, and in that case TWS just starts the normal full log in dialogue, which is what you're seeing. Because it thinks autorestart is happening, IBC ignores the login dialog and doesn't enter the user I'd and password?



From: [email protected] <[email protected]> on behalf of Despair <boris@...>
Sent: Monday, May 27, 2024 10:58:47 pm
To: [email protected] <[email protected]>
Subject: Re: [ibc] Strange problem

Thank you very much. Here is the log file.


Re: Strange problem

 

@Richard: I'm both embarrassed but also relieved to report that it now (new trading day) again works as usual. I haven't changed a thing...


Re: Strange problem

 

Well, send your IBC logfile. Attach it please, don't quote it.?



From: [email protected] <[email protected]> on behalf of Despair <boris@...>
Sent: Monday, May 27, 2024 5:04:08 pm
To: [email protected] <[email protected]>
Subject: Re: [ibc] Strange problem

..I now entered the credentials also in the startTWS.bat but it didn't help. It simply doesn't fill in the information any longer. :-S


Re: Strange problem

 

..I now entered the credentials also in the startTWS.bat but it didn't help. It simply doesn't fill in the information any longer. :-S


Re: Strange problem

 

I did this. The config.ini has the correct credentials in it. However when I run startTWS.bat the are not filled in like usual. Very strange.


Re: Strange problem

 

If you extracted the new version of config.ini when you reinstalled, you'll need to make sure all the settings you had before are still there, including the userid and password.?



From: [email protected] <[email protected]> on behalf of Despair <boris@...>
Sent: Monday, May 27, 2024 8:44:15 am
To: [email protected] <[email protected]>
Subject: Re: [ibc] Strange problem

Well I had it in the config.ini.


Re: Strange problem

 

Well I had it in the config.ini.


Re: Strange problem

 

No, not necessarily. If you read the IBC user manual it gives pointers on how to keep your credentials safe. This includes not putting them in the settings file, but in a separate file, in a different location. If any of these files got corrupted due to your crashing computer it might not work anymore afterward.