Keeping IB TWS up

Discussion in 'Automated Trading' started by drbob101, May 28, 2013.

  1. I've done this for years so it has been multiple versions of TWS but currently I'm using the UNIX version of TWS version 938.1 from May 1, 2013.
     
    #11     May 28, 2013
  2. drbob101

    drbob101

    I downlaoded it and extracted it but I havent a clue how to set it up after reading the readme. Any help would be appreciated.
     
    #12     May 28, 2013
  3. ktm

    ktm

    Thanks guys. I need to give this a shot.
     
    #13     May 28, 2013
  4. Yeah, I can help if you have some specific questions. The options may have changed slightly since I have an older version than what is now available most likely. It is a little tricky to get working. The major file is IBController.ini. You need to add your TWS login id (IbLoginId=...) and password (IbPassword=...) (you can add it as encrypted using the IBControllerEncrypt.bat to get this). Point (IbDir=...) to the path of your Jts folder and set (IbAutoClosedown=no).

    Then you create a batch file (Windows) or bash script to invoke IBController when calling TWS... the README points to some example files. I usually just take the default IB calls and add the following to the end of the java command:

    "ibcontroller.IBController /path/to/IBController.ini"
     
    #14     May 28, 2013
  5. drbob101

    drbob101

    I am fairly computer savvy and I will try and work through this but the second paragraph there has me scratching my head. Thank you for the reply though.

    I have a system I have developed that looks very good and I want to try it at least in sim and it is written in a program that can only use IB to trade from thus the dilemma.

    Thanks again
     
    #15     May 28, 2013
  6. Just some clarification on the last paragraph since it wasn't clearly written. TWS is nothing more than java archive files that are called from a script containing a set of commands using the java run-time executable.

    These files are the same for Windows, UNIX or Mac but they are called in slightly different types of files depending on the platform (a batch file for Windows or Bash shell script for UNIX/Mac).

    All that we are doing with IBController is adding another jar file to the list of files loaded by the command you normally call to open TWS (Look in the properties of the icon you use to open it and you will see what I mean) called IBController.jar (I left this out of my previous example) and this is what automatically logs you in and takes over to prevent the automated exit. Actually all that it does is continually adjust the auto-exit time so that TWS never actually reaches the appointed "exit time".

    Here is the full contents of a Bash script that I use to call TWS with IBController...

    /usr/bin/java -cp /path/to/jts.jar:/path/to/hsqldb.jar:/path/to/jcommon-1.0.12.jar:/path/to/jfreechart-1.0.9.jar:/path/to/jhall.jar:/path/to/other.jar:/path/to/rss.jar:/path/to/IBController.jar -Xmx512M ibcontroller.IBController /path/to/IBController/IBController.ini
     
    #16     May 28, 2013