🟨
Swiss33
🏠 Swiss33
  • ⚡Quickstart
  • ℹ️General
  • ⚙️Models
    • Interactive Brokers
  • 🤖Trading bots
Powered by GitBook
On this page
  • Video tutorial :
  • Text tutorial :
  • 1. Setup Ngrok
  • 2. Setup TradeWorkstation
  • 3. Setup Swiss33

Was this helpful?

  1. Models

Interactive Brokers

How to create a model based on Interactive Brokers' data

PreviousModelsNextTrading bots

Last updated 2 years ago

Was this helpful?

Video tutorial :

Text tutorial :

3 steps:

  • Setup Ngrok

  • Setup TraderWorkstation

  • Setup Swiss33

This tutorial works for both MacOS and Windows.

1. Setup Ngrok

  • You must get this page :

  • In a terminal, enter :

ngrok config add-authtoken YOUR_PRIVATE_TOKEN
  • It must echo :

Authtoken saved to configuration file : path\to\file\ngrok.yml

2. Setup TradeWorkstation

  • If you want to trade with virtual money, log in to the paper mode, else in the live mode

  • In the TWS, go to Settings > API > Settings

  • Check "Enable ActiveX and Socket Clients"

  • Uncheck "Read-Only API"

  • Remember the socket port (7497 by default for paper trading, 7496 for live trading)

  • Click on "Apply"

  • Go to your terminal and enter :

ngrok tcp 7497

if your modified the socket port to 6666, for instance, it should be :

ngrok tcp 6666
  • copy the link that starts with "tcp", in the format tcp://x.tcp.xx.ngrok.io:xxxxx

3. Setup Swiss33

  • Create a model, by choosing the algorithm you want and of course Interactive Brokers as a data source

  • You will be asked to enter the link you copied right before :

  • So, enter your link tcp://x.tcp.xx.ngrok.io:xxxxx in "Trader Workstation's connection"

Done !

You can the train your model, backtest it, deploy it as a bot like for any other broker.

Don't forget that while you handle data from Interactive Brokers, your TWS and Ngrok must be on, otherwise it will stop.

Make sure to have a working Interactive Brokers account :

Go to

Sign up, verify your e-mail address, download an install

Download, install and launch

Go to the model's page of

⚙️
https://www.interactivebrokers.com/
https://ngrok.com/
ngrok
TWS
Swiss33