Interactive Brokers TWS
[ ! -d /opt/home/herrold/trender/ib/ ] && \ mkdir -p /opt/home/herrold/trender/ib/ cd /opt/home/herrold/trender/ib/ mkdir temp cd temp wget http://www.interactivebrokers.com/download/unixmacosx.jar cd .. md5sum `find -name 'unix*.jar'`| sort # # inspect the md5sum result - is the version in ./temp/ new? #
# if stale rm -rd temp... but occasionally a new release appears. When it does, we need to find out what it thinks its version is. File permissions note: The directory hierarchy in which the TWS is run needs to be writable by the Linux userid in which it is started, to create a sub-directory tree, which sub-directory name is a 'hashed' value of the IB username in which the login to IB occurs certain persistent settings, and configuration files, such as chart parameters (which are shared between the various usernames of that TWS instance).
cd temp jar xf unixmacosx.jar cd IBJts java -cp \ jts.jar:jcommon-1.0.0.jar:jfreechart-1.0.0.jar:jhall.jar:other.jar:rss.jar \ jclient.LoginFrame .and note the version information in the banners in the console window (one need not supply credentials and authenticate):
[herrold@centos-4 IBJts]$ java -cp \ jts.jar:jcommon-1.0.0.jar:jfreechart-1.0.0.jar:jhall.jar:other.jar:rss.jar \ jclient.LoginFrame . 12:33:30:235 JTS-Main: Build 857.7, Apr 3, 2006 6:08:33 PM [herrold@centos-4 IBJts]$and them move back up into ./temp/ and rename the file more descriptively:
cd .. mv unixmacosx.jar unixmacosx-857.7.jar mv unixmacosx-857.7.jar .. # # clean up for a future pull cd .. rm -rf ./temp
mkdir tws_ver_857.7 mv unixmacosx-857.7.jar tws_ver_857.7 cd tws_ver_857.7 jar xf tws_ver_857.7 # # this will make the subdirectories IBJts and META-INF cp ../README .
[herrold@centos-4 tws_ver_857.7]$ cat README
#!/bin/sh
#
# http://www.interactivebrokers.com/download/unixmacosx.jar
#
# jar xf unixmacosx.jar
#
JFREE="1.0.0"
JCOMM="1.0.0"
# rss.jar new at 856.5
JREST="jhall.jar:other.jar:rss.jar"
#
cd IBJts
java -cp \
jts.jar:jcommon-${JCOMM}.jar:jfreechart-${JFREE}.jar:${JREST} \
jclient.LoginFrame .
#
[herrold@centos-4 tws_ver_857.7]$
We use the script to act as a 'target' for another (more complex) script,
in the regular executable path, and which attends to keeping debugging logs,
and such on an automatic basis:
[herrold@centos-4 tws_ver_857.7]$ cat ~/bin/run-tws
#!/bin/sh
#
YMD=` date +%Y%m%d `
cd /opt/home/herrold/trender/ib/
# cd tws_ver_857
#
cd tws_ver_856.5
# pbm 060412 w 857.7 charting
# cd tws_ver_857.7
WHR=` pwd `
#
echo "$YMD"
echo "start ${YMD} ${WHR} "
#
date >> transcript-${YMD}.txt
echo "start ${YMD} ${WHR} " >> transcript-${YMD}.txt
echo " -- view with fmt -tcs (file)" >> transcript-${YMD}.txt
( ./README 2>&1 ) | tee -a transcript-${YMD}.txt
date >> transcript-${YMD}.txt
echo "end" >> transcript-${YMD}.txt
echo " " >> transcript-${YMD}.txt
#
#
[herrold@centos-4 tws_ver_857.7]$
This permits substituting various testing versions in and out with little
effort, and also has logging collection within it. This does NOT however
move over a live set of debugging configuration. We manually prepare those
configuration (see the files: log.filter and subscribe in the tarball, in
the ./bin/ subdirectory).checkVersion=0A revised sample file might look like this:
[Logon] |