Tag Archives: Shim

Meet your C++ HFT trading shim

Meet your HFT trading shim

This is old. I mean really old for Interactive Brokers. I can say I never got this working but if anyone out there can resurrect this project, let me know!

http://trading-shim.org/

What is a shim?

https://en.wikipedia.org/wiki/Shim_(computing)

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Budish, Cramton and Shim on HFT: the Arms Race of High Frequency Trading from the Grumpy Economist (not me so sorry)

Budish, Cramton and Shim on HFT: the Arms Race of High Frequency Trading from the Grumpy Economist (not me so sorry)

This was a research MBA paper discovered by the world famous NYC Contact.

Thanks to him

http://johnhcochrane.blogspot.ca/2014/02/budish-cramton-and-shim-on-high.html

http://faculty.chicagobooth.edu/eric.budish/research/HFT-FrequentBatchAuctions.pdf

Join my FREE newsletter to see how we implement HFT strategies

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Youtube video: My open source C++ trading platform Shim for Ubuntu Linux with MYSQL and Netbeans IDE demo

Youtube video: My open source C++ trading platform Shim for Ubuntu Linux with MYSQL and Netbeans IDE demo

Here is my checklist of stuff:x , MYSQL , Netbeans ,IDE ,demo

Optional but required instructions below:
1. Install R onto Ubuntu
http://ubuntuforums.org/archive/index.php/t-702173.html
sudo apt-get update
sudo apt-get install r-base

Users who need to compile packages should also install the r-base-dev package
===
GNUPlot
Prerequisites

We need to make sure some packages are already installed before we try to compile gnuplot

libwxgtk2.8-dev – for the wxt terminal
libpango1.0-dev – for the cairo (pdf, png) and wxt terminals
libreadline5-dev – readline support (editing command lines)
libx11-dev and libxt-dev – X11 terminal
texinfo (optional) – needed for the tutorial
libgd2-xpm-dev (optional) – old png, jpeg and gif terminals based on libgd

This command (run in a terminal) will install all prerequisites if not already installed:

sudo apt-get install libwxgtk2.8-dev libpango1.0-dev libreadline5-dev libx11-dev libxt-dev texinfo libgd2-xpm-dev

Then we download and compile gnuplot (run each command/line in a terminal)

wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.0/gnuplot-4.4.0.tar.gz/download
tar xzf gnuplot-4.4.0.tar.gz
mkdir build && cd build
../gnuplot-4.4.0/configure –with-readline=gnu

Install Gnuplot 4.4.0 on Ubuntu Linux


Required for my Ubuntu Linux version:
g++
MYSQL:
sudo apt-get dist-upgrade:
sudo apt-get install mysql-server mysql-client
sudo mysqladmin -u root -h localhost password ‘mypassword’
sudo mysqladmin -u root -h myhostname password ‘mypassword’
http://ariejan.net/2007/12/12/how-to-install-mysql-on-ubuntudebian

Ruby: apt-get install ruby
To build Trading Shimm, you need the MYSQL developer RPM which is from dev.mysql.com/downloads/mysql/ or
sudo apt-get install libmysqlclient-dev
from http://ubuntuforums.org/showthread.php?t=637973

UPDATE: See below for proper installation for IB TWS in Ubuntu or any Linux/Unix
Install Interactive Brokers TWS for Ubuntu:
http://ubuntuforums.org/showthread.php?t=1344734
1. Make sure that you have a recent version of Java Runtime Environment installed.
2. Go to http://www.interactivebrokers.com/en…&ib_entity=llc and download the standalone app for unix.
3. Create a folder called “TWS” or “IB” or whatever you want in your home directory.
4. Find and right click the downlaoded file called “unixmacosx.jar” and select “Open with Archive Manager”
5. Select the two folders “IBJts” and “META-INF” and select extract
6. Navigate to the folder you just created in step 3 and extract the folders there.
7. Open up a terminal window and change directory to the folder where your IB files reside. e.g. “cd TWS” or “cd IB”
8. Change directory to the IBJts folder, “cd IBJts”
9 Then type
Code:

java -cp jts.jar:hsqldb.jar:jcommon-1.0.12.jar:jfreechart-1.0.9.jar:jhall.jar::KSother.jar:rss.jar -Xmx512M jclient.LoginFrame .

including the period at the end and you should get the login page.
10. Henceforth to launch TWS you have to follow steps 7-9
Log into TWS with:
userid: edemo
password: demouser
Run TWS and then execute ./shim
Get the Trading Shim manual from http://www.tradingshim.org/pdfs/manual.pdf
Configure TWS as explained in the TradingShim manu 3.2.2 Allow Connections to the IB tws. Go under Global Configurations
Load MYSQL data as described in the manual:
Make change to \etc\mysql\my.cnf (pg 41)
In MYSQL as root, run ‘source setup.sql’ from shim’s sql directory
May need to execute examples in ‘Using the create.sql Script to Recreate the Tables’ pg 44
create.sql under sql/mys
For debugging Trading shim, I would use Netbeans IDE for C++. Coulse markfile as source of Netbeans project when import source.

Update: For MYSQL Isolation level to seriazilable, do in MYSQL shell:

set global transaction isolation level serializable;

Update: (Oct 25/2012)

If you ever see any strange problems trying to run the JAR files for IB TWS, here is a set of references to help out:
http://ubuntuforums.org/showthread.php?t=1344734

http://www.interactivebrokers.com/en/control/systemstandalone.php?os=unix&ib_entity=llc

 

 

 

 

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!