Think or Swim on Ubuntu 20.04 / Focal Fossa

It will be interesting to see what happens with Think or Swim and Charles Schwab in the coming years as the two merge. Retail brokerages are slowing consolidating and going by the wayside as Robinhood / options become all the rage.

I use Interactive Brokers for all my trading because I believe hands down they have the best API for all my needs. However, I use TOS in all my chart analysis and developing my algorithmic strategies.

I have written about installing Think or Swim on previous versions of Linux, so I thought I would update to Focal Fossa cause once again TOS directions didn’t work.

Start with some java:

1. install sudo apt install openjdk-8-jre

2. Download the installer

3. cd /Downloads && sudo chmod +x thinkorswim_installer.sh

4. install sh ./thinkorswim_installer.sh

m The installer should start the application for you. The TOS small box will pop up and say that it is installing updates. This seems to take a long time, like 5 minutes? So go do something else for a few. Then you should get a login screen after a while.

Note: If you find any discrepancies or tips please leave them in the comments. I will do my best to post them, as this blog post and the other Ubuntu / TOS get a lot of hits, there are people out there that need hits.

Simple guide to build TWS API on AWS EC2 instance

Currently, I’m running 2 different Interactive Brokers Trader Work Station (TWS), my own propriety python trading algorithm on an AWS EC2 instance. This is very simple instructions to get you one started, it is not the cure all.

  1. Build an AWS EC2 instance / 18.04 Ubuntu
  2. SSH into the instance
  3. Insert the following code as required

Cover the basics:

Sudo mkdir code && 
cd code && 
sudo apt-get update -y &&
sudo apt-get clean -y &&
sudo apt-get autoremove -y && 
sudo apt-get install mysql-server -y && 
sudo apt-get update -y &&
sudo apt install python3-pip -y && pip3 install pandas matplotlib seaborn plotly pymysql sklearn 

The are two ways to VNC into your EC2 instance. The RealVNC method is little more complicated and it is an enterprise solution.

  1. https://help.realvnc.com/hc/en-us/articles/360003474572-How-do-I-get-started-with-VNC-Connect-on-Linux-
  2. xhost +local:Name_of_your_computer
  3. sudo apt install ./VNC-Server-6.6.0-Linux-x64.deb
  4. tar -xzf vncsetup-helper.tar.gz
  5. sudo ./vncsetup.sh
  6. sudo reboot

If you want a simple VNC method follow this bloggers instructions.

Interactive Brokers

  1. follow instructions: http://interactivebrokers.github.io/
  2. sudu unzip twsapi_macunix.979.01.zip -d /home/user/
  3. cd IBJts/source/pythonclient/
  4. sudo apt-get install python3-setuptools && sudo python3 setup.py install
  5. Download TWS https://www.interactivebrokers.com/en/index.php?f=16040 follow instructions on the screen. (if you want to use IB gateway, which is not as sexy but works fine you can get it here)
  6. git clone your repo