Trader Workstation

From Wiki

Linux installation

  • download tws
  • ~/TWS/tws.sh
#!/bin/bash
cd IBJts
java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar:other.jar:rss.jar -Xmx512M -XX:MaxPermSize=512M jclient.LoginFrame . &
  • ~/TWS/gateway.sh
#!/bin/bash
cd IBJts
java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jhall.jar:other.jar:rss.jar -Dsun.java2d.noddraw=true -Xmx512M ibgateway.GWClient . &

autologin + keep alive

  • apt-get install devilspie xdotool
  • ~/.devilspie/tws_login.ds
(if (matches (application_name) "Login")
	(begin
		(if (matches (window_name) "Login")
			(begin
				(if (is (window_class) "jclient-LoginFrame")
					(begin
						(println "TWS Login window detected")
						(center)
						(above)
						(spawn_async 'sh /home/user/.devilspie/tws_login.sh')
					)
				)
			)
		)
	)
)
  • ~/.devilspie/tws_login.sh
#!/bin/bash

wid=$(xdotool search --onlyvisible --name Login)

xdotool windowactivate $wid

xdotool type "tws_user"
sleep 0.2
xdotool key Tab
sleep 0.2
xdotool type "tws_pass"
sleep 0.2
xdotool type --delay 50 "					"
sleep 0.2
xdotool type --delay 50 " "

  • ~/.devilspie/tws_autologoff.ds

  • ~/.devilspie/tws_autologoff.sh