In some cases (rarely but it is definitely a problem) I start my automated trading and, a few hours later, within the same session (within those 24 hours that do not have the forced disconnection), presumably after a disconnection, I get asked again for the login code from the IB security code card authentication.
What happens is I connect to my server, and see the popup window asking for the security codes, and since my trading is automated, this also means that the DDE data feed to excel has stopped (sometimes for hours) and my daily automated trading session has been compromised.
This has been happening for the past two months, at the frequency of once every two weeks, so it has happened already four times. Does anyone (from IB or forum users) know what I could do to fix this problem, which is not just my problem presumably? This is a very recent problem and before this, disconnections did not cause it, and IB TWS could get reconnected without the need for me to fill in the security codes again.
I can not answer to your question but I think I am having the exact same problem. I have been getting the same disconnection and popup box asking for my security code almost every day. TWS will continue indefinitely to give me another login popup box. This disconnection is not due to the TWS reset after midnight or the TWS automated log-off once a day. This has been happening for about the last two months. I am in the USA and using TWS build 923.6.
Yes, good question (TD80). I am (the server is) in the US as well, and I cannot tell you the build right now (I am at the office, with a firewall), but I've updated it a couple of months ago, which reminds me that I'll have to do an update of the build to the latest version as soon as I restart TWS tonight.
Also, I could not agree more with Catoosa: everything that he says applies to me, except the frequency of the problem. I've had it for the past two months, but once every two weeks. And this morning, but it's not always the case, it did happen after their server restart (at midnight CT).
This is definitely a known issue for automated trading and IB. Not much you can do about it but babysit the connection with Tws. I have tried to raise this issue directly with IB but it has gone nowhere and no one even can explain why the regular disconnects even at midnight are still necessary. My guess is that they have always done it this way and just continue to do so even though technically it should not be necessary.
Outside of the midnight issue, disconnects causing the security token login are infrequent for me but are still a real obstacle to true unattended automated trading systems. Even IB's Gateway has the exact same behavior which I thought was supposed to better enable unattended trading but apparently not.
If you are "comfortable" with going this route, you can create a second login with limited functionality (i.e. Trading only or administrative, etc) that does not require the passcode token and use that for your automated stuff. If your setup is secure enough, it might be an alternative to look at.