Skip to content

Set up TWS or IB Gateway

Tented connects to the TWS or IB Gateway on your computer, so the API must be on there and the port must match.

Enable the API in TWS or IB Gateway

  1. TWS: File → Global Configuration → API → Settings. IB Gateway: Configure → Settings → API.
  2. Check Enable ActiveX and Socket Clients.
  3. Add 127.0.0.1 to Trusted IPs.
  4. Note the Socket port.

Set the connection in Tented

Open Settings → Connection, or click the connection chip. Under Market data source, choose Interactive Brokers.

  • Host: 127.0.0.1 by default.
  • Port: 7496 (TWS live) by default. Four tiles fill in the usual ports: 7496 TWS live, 7497 TWS paper, 4001 Gateway live, 4002 Gateway paper. You can type any other port.
  • Client ID: 99 by default. Each program connected to the same TWS needs its own.
  • Market data type: Real-time (default) or Delayed.
  • Line allowance: see Market-data lines.

Click Connect (Reconnect once connected); the result shows beside the button. The setup wizard’s Market data step has only Host and Port, the port tiles and a Test connection button.

Connect at launch (Settings → General) is on by default. Off, Tented starts disconnected and you connect from Settings → Connection or the connection chip. There is no Disconnect button; turn this off to start Tented without connecting.

If the connection fails, see Waiting for IB. Thinkorswim is the only other market data source, and only on Windows.