Keyboard Shortcuts
Likes
- Ibcalpha
- Messages
Search
Re: AutoRestart File INFO LOG
开云体育This is just a little diagnostic to help me if there are any issues with the auto-restart. I’ll probably remove it at the next release. ? It’s of no concern, and is expected when not in an auto-restart situation. There is no way to suppress the messages. ? I have absolutely no idea why it should appear on the console when nothing else does. It might be worth giving me the full logfile so I can get a fuller picture. ? And as I keep saying over and over again (if anyone else is reading this), please send the whole log file with your queries – don’t extract bits of it because experience shows that extracts nearly always don’t contain the information I need. ? Richard ? ? From: [email protected] <[email protected]> On Behalf Of agftrading@...
Sent: 19 December 2022 15:15 To: [email protected] Subject: [ibc] AutoRestart File INFO LOG ? Hi Richard, INFO: Could not find files for the given pattern(s). autorestart file not found? |
AutoRestart File INFO LOG
Hi Richard,
Here is an excerpt from a log file.? The INFO logs to the console and not just the file. Finding autorestart file INFO: Could not find files for the given pattern(s).
autorestart file not found? Multiple questions: what does this signify? is it something to fix? or if not a concern, how do I suppress this log to the console? (no others show) FYI Version?3.15.2.? If you need more info from the log file, please let me know. Thanks, Alistair |
Re: Restart TWS without IBC to keep session
开云体育Ok, noted. ? From: [email protected] <[email protected]> On Behalf Of Riks
Sent: 17 December 2022 18:25 To: [email protected] Subject: Re: [ibc] Restart TWS without IBC to keep session ? Thanks, but really it would be great to have RESTART command, similar to the STOP for full automation of the process. ? Regards, Alexander |
Re: Restart TWS without IBC to keep session
As it happens, TWS has a File | Restart... menu item which does exactly what you want. It works with IBC exactly as you'd expect, just like an auto-restart - in fact IBC can't tell the difference between the two. It would be possible to provide a RESTART command, similar to the STOP command, but are you able to just use the menus manually?? Note that this restart menu item isn't available for Gateway, but maybe IB will provide it in a future version.? Richard? From: [email protected] <[email protected]> on behalf of Riks <atsdev@...> Sent: Saturday, 17 December 2022, 13:48 To: [email protected] <[email protected]> Subject: [ibc] Restart TWS without IBC to keep session Hi,
?
First of all, thank you very much for your work, Richard. And my question: is there any way to restart programmatically TWS tidy without closing IBC (like a daily restart) to keep the same session during the week (I need this if something wrong happened for example API couldn't connect due to socket error and etc.) Stop.bat close IBC as a result new session and 2x factor authentification.
?
Regards,
Alexander
|
Restart TWS without IBC to keep session
Hi,
?
First of all, thank you very much for your work, Richard. And my question: is there any way to restart programmatically TWS tidy without closing IBC (like a daily restart) to keep the same session during the week (I need this if something wrong happened for example API couldn't connect due to socket error and etc.) Stop.bat close IBC as a result new session and 2x factor authentification.
?
Regards,
Alexander |
Re: handle restarts
开云体育Here is the revised User Guide description for running IBC under Windows Task Scheduler: ? Scheduled Tasks (Windows only) ? On Windows you can start IBC automatically using the Task Scheduler to run StartTWS.bat or StartGateway.bat. ? When you define your task, make sure that the option to 'Run only when user is logged on' is selected. Doing this will ensure that you can see and interact with TWS. ? You will then need to log on to Windows before the task runs. ? Note that you can set up Windows to log on automatically at startup: this might be useful, for example, if your system's BIOS allows you to configure the system to power on at a particular time. Information on how to do this is freely available on the internet. But bear in mind that doing this can negatively impact your system's security. ? Task Scheduler does actually allow you to specify that your task should run whether or not the user is logged in. However if you do this, the task is always started in a separate user session which you cannot see and interact with, even if you are already logged on when the task starts, or if you subsequently log on. Therefore you are strongly advised NOT to use the option for 'Run whether user is logged on or not'. ? Remember also to change the task settings to prevent Windows automatically ending it after a certain time. ? You can set the AutoRestart time in the Lock and Exit section of the configuration dialog: this causes TWS/Gateway to automatically shut down and restart without requiring re-authentication at the specified time. When the restart time is reached, TWS shuts down (and IBC with it), but this does not end the task, because the StartTWS.bat or StartGateway.bat script continues running to restart IBC. The restarted IBC then reloads TWS with the relevant information needed for it to recover its previous session without re- authentication. This sequence is then repeated each day at the same time. Thus TWS can be kept running all week, with automated startup and a single authentication at the start of the week. Note that this is all the same task, since the start script run by the Task Scheduler keeps running all the time. ? Finally on the Sunday, if the task has not been ended before then, IB will prevent that session running any further because the session credentials expire. At this point it is necessary to start a new task to begin the whole cycle over again. ? Since there is little point having TWS running after Friday evening (because the markets are closed), you can use the ClosedownAt setting in config.ini to tidily shut down TWS automatically after the Friday trading session has finished. ? Note that TWS's auto-restart mechanism does not operate if TWS is shut down other than at the auto-restart time: for example via the File | Exit menu, or due to power failure or a program bug. This situation can be handled by configuring the task to run periodically (say every 10 minutes) during the week so that if TWS crashes or is manually shut down, the task is automatically restarted. Make sure the task is also configured to prevent a new instance if one is already running. ? Note also that if you set up the task to run at user logon, and you configure your computer's BIOS to power on when power is restored after failure, and to then log on automatically, this will ensure TWS is restarted after a power outage. (Information about how to make your computer log on automatically is easily available on the internet: but make sure you understand the security implications of autologon to Windows). ? **IMPORTANT** Make sure you use the /INLINE argument to StartTWS.bat or StartGateway.bat when starting IBC from Task Scheduler. Otherwise IBC starts and runs correctly, but Task Scheduler is not aware of it: in particular Task Scheduler does not show the task as running. This prevents correct operation of Task Scheduler features such as killing the task after a specified elapsed time, and periodic restarts as described above will result in multiple IBC instances being started, with unpredictable results. The reason for this is that if `/INLINE` is not used, the start scripts create a new window to run IBC in, and Task Scheduler is not aware of this, so the task ends as soon as this new window has been created. ? A sample scheduled task is included in the IBC distribution ZIP, called Start TWS Live (daily).xml. You can import this into your Task Scheduler if you are running Windows. After importing it, you will need to enable it and change the user account it runs under. This task starts TWS daily from Sunday to Thursday at 22:15, and assumes that TWS is set to autologoff shortly before this. It restarts the task every 10 minutes. You can adjust these times to suit your needs. ? Richard |
Re: handle restarts
开云体育Actually you can achieve this just using Task Scheduler, if you configure the task correctly. ? I don’t know if you’ve seen the section on running under Task Scheduler in the User Guide: if not, I suggest you read it. ? However I just realised today that this section contains some errors. I’ll try to send out an update to it later tonight. ? Basically all you need to do is to set the task to run every (week)day at a particular time, and to restart the task every 5 minutes (for a duration of say 1435 minutes); also set the task to not run if there is already an instance running. And make sure you use the /INLINE parameter to the start script. And configure AutoRestart time to a suitable time (ignore the stuff in the current User Guide description about not using AutoRestart – it’s wrong).. ? Hopefully that will be enough to get you going, and if not then my revised description should help (when I’ve written it!...). ? Richard ? ? ? From: [email protected] <[email protected]> On Behalf Of nkulki@...
Sent: 16 December 2022 16:38 To: [email protected] Subject: Re: [ibc] handle restarts ? what? I have done is that I assume that when TWS is running, its through IBC. IBS launches a shell with the title "IBC (TWS 1020) - C:\IBC\scripts\DisplayBannerAndLaunch.bat" |
Re: handle restarts
what? I have done is that I assume that when TWS is running, its through IBC. IBS launches a shell with the title "IBC (TWS 1020) - C:\IBC\scripts\DisplayBannerAndLaunch.bat"
So I try to locate if I can find a open cmd shell with that title. If it finds it, then exit else attempt to launch TWS. I used this script to detect if I had an open shells that matched the title |
handle restarts
What I am hoping to do is to create a script that will run say every 5 minutes. It will check if TWS is running. If its running then it should just quit if its not running then it will launch TWS. ANy clue on how to detect if TWS is currently running. I am on windows and the task manager just shows as Java. There is no way to tell its TWS or some other java application.
|
Re: The alerts from IBKR app are easy to miss ... my solution
Mark, I've played with the following: { .... "priority" : 2, "retry" : 60, "expire", 300 .... } There's also an option in the app (not on the python side) to play high priority as an alarm instead of a notification sound.? This will bypass volume settings. Also note that it doesn't play if the Pushover app is open and visible:?? On Fri, Dec 16, 2022 at 9:27 AM Mark Murari <markm00001@...> wrote: Have also added the python version script which sends to my my phone - thanks for the tip up Jonathan.? |
Re: The alerts from IBKR app are easy to miss ... my solution
Have also added the python version script which sends to my my phone - thanks for the tip up Jonathan.?
If anyone knows how to change the volume and priority settings through python, would be grateful. I have tried changing the volume settings for critical alert and defaulting to to critical on the app but to no avail. |
Re: has IB just changed 'bingo card' authentication for offline TWS?
Jon B
I spoke with IB.? They have changed their policy, and are now requiring 2FA for TWS trading.
My TWS setup is such that I need to restart TWS daily.? I had previously had IB 'auto logoff' daily at 3 AM, and had IBC start it back up at 4 AM. IB pointed out that TWS has an option to restart IB daily, without requiring a fresh login.? So memory leaks, etc in TWS can get cleaned up daily, without requiring a new 2FA login.? IB will still reset tokens weekly on Sunday at 1 AM.? So you'll still need to enter your 2FA on Sunday or Monday.? The option to setup a daily restart is under 'Lock and Exit' in 'Global Configuration'. Hope this helps anyone in a similar situation to my own. Cheers, Jon |
has IB just changed 'bingo card' authentication for offline TWS?
Jon B
I have an IB 'bingo card', but have had things configured in IB's back-end, such that the bingo card is necessary for Account Management, but NOT necessary for TWS.
This has worked great with IBC for years.? (Thank you Richard for all your hard work!) This morning, TWS started fine.? But when I did a restart this afternoon with IBC, I'm being prompted for the authentication codes.... This doesn't seem directly related to IBC, but I thought there might be numerous other users on this list experiencing the same issue.? Anyone else seeing this same issue? Thanks, Jon |
The alerts from IBKR app are easy to miss ... my solution
In my automated setup, I'm restarting IBC/TWS with a cron job every Sunday so that the 2FA session lasts throughout the week.? I'm also attempting a restart every 5 minutes in case TWS is down for an unknown reason.
However, I find the alerts on the phone from IBKR for 2FA are very easy to miss.? What I did in my script is add (very obnoxious) alert to get my attention in the cases where my script needs to restart TWS and 2FA is needed using Pushover (? I think it's one-time $5 app) which allows for alarm like messages that beep until you physically acknowledge them on the phone and can be set up to override "do not disturb".? ?
Putting this here in case anyone runs into the same issue |
Re: AWESOME IBD Auto-login
开云体育Thanks. ? I’m jolly glad it does! I hate that sinking feeling I get when someone says ‘IBC vX.Y.Z doesn’t work’ (especially when they don’t include their logfile…), because I know it does work and 9.5 times out of ten they’ve just made a mistake in their setup. ? But I can’t talk – I make as many mistakes as anyone else, possibly more, hence three goes to get 3.15 working properly. I’m getting too old for this game… ? Richard ? ? ? From: [email protected] <[email protected]> On Behalf Of Kevin Jameson
Sent: 09 December 2022 23:55 To: [email protected] Subject: [ibc] AWESOME IBD Auto-login ? I recently upgraded to TWS 1019 and IBC 3.15.2. |