In the first part of this article, “Installation IBController for automatic 24h stock trading (part 1)”, we have downloaded and installed all important programs. In this second part we would like to complete the initial configuration of IBController to enable you a 24/7 continuous operation on stock trading.
Windows vs. Linux vs. Macintosh
TWS is based on the programming language Java which is a platform-independent language and can be used on any operating system. The following description is basically for all Windows users, but it can also be used for other platforms such as Linux or Macintosh.
Locate your TWS installation directory. You should usually find this directory in directory JTS on your hard drive C.
We see a subfolder for each version (e.g. Generic, 952, 958, 960) of the TWS in the JTS directory. We currently have only one TWS version installed on our system and therefore we do see only one subfolder with the version number 960 in our Windows Explorer.
IBController does not have a sophisticated installation procedure because you are able to install it by coping the data into the target folder. Now move the content of the IBController *.zip file into a new directory on your hard drive C.
Open with a text editor the two *.bat files IBControllerStart.bat and IBControllerGatewayStart.bat in the IBController directory and update the TWS version number you are using. We use 960, so we change this version number one time in both *.bat files to this version number, save the files and close the editor.
The *.sh files are “shell scripts” and are required for Linux and Macintosh. If you are using these operating systems you should update the *.sh files instead of the *.bat files.
The configuration of IBController is done via the INIT file with the name IBController.ini. The file is delivered in the *.zip file.
Now create another IBController Folder in your personal user directory.
Move the INIT file from above from the IBController installation directory to your newly created directory in your user directory.
- LogToConsole=yes (area 1)
From our point of view, this setting is an advantage because the more logging data is generated, the easier is it to search for errors.
- ClosedownAt=Saturday 21:00 (area 5)
It is recommended to restart the TWS in regular intervals. This setting would shut down the TWS every Saturday night.
If you have installed the german version of JAVA you should format this text in german language: Samstag 21:00. More information about localization and date objects please have a look in the java docs: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html#text