This website already describes OptionsApp 2.0, release on 08.10.2026. Until then, the download offers version 1.10. Stocks, ETFs and some new features are only available from the release onwards.
OptionsApp

TWS API Settings

Updated: April 26, 20254 min read

1. Overview

For the connection between Interactive Brokers' Trader Workstation (TWS) and OptionsApp to work reliably, both the API settings in TWS and the connection settings in OptionsApp must be configured correctly.

The connection settings of OptionsApp are located in the "Settings" section. The API settings are configured directly in Trader Workstation.

2. Connection Settings in OptionsApp

2.1 Host

The "Host" field specifies the computer on which Trader Workstation is running.

By default, the IP address of the current computer is entered here. If OptionsApp and TWS run on the same computer or server, the entry does not need to be changed.

An adjustment is only required if OptionsApp and TWS run on different systems.

Example:

In this case, the IP address of the server on which TWS runs must be entered in the "Host" field.

2.2 Client-ID

The Client-ID is used to uniquely distinguish API connections.

For OptionsApp, Client-ID 0 is recommended.

In TWS, the value 0 should also be entered under "Master API Client ID".

2.3 Port

The port determines which connection channel OptionsApp uses to communicate with TWS.

The port entered in OptionsApp must exactly match the Socket Port stored in the TWS API settings. If the values do not match, no connection can be established.

If several TWS instances run in parallel, each instance must use its own port.

Example:

  • Live account: Port 7496
  • Paper account: Port 7497
  • Additional TWS instance: Port 7498

2.4 Timezone

The "Timezone" field specifies the time zone OptionsApp works with.

The time zone should be set identically in all systems involved:

  • in OptionsApp
  • in TWS
  • on the computer or server

The recommended time zone is US/Eastern, because most options strategies refer to US Underlyings and US trading hours.

A different time zone can be used, provided that TWS, OptionsApp and the system time match completely. Deviating settings can lead to incorrect trading hours, incorrect close times or problems with Entry and Exit Conditions.

2.5 Market Data Lines

The Market Data Lines specify how many parallel market data requests OptionsApp may use.

By default, Interactive Brokers often provides 100 Market Data Lines. In most cases, the value in OptionsApp can therefore stay at 100.

A correspondingly higher value should only be entered if additional Market Data Lines have been activated at Interactive Brokers.

3. TWS API Settings

The following API settings must be configured in TWS:

  • Enable ActiveX and Socket Clients (check the box)
    This setting allows OptionsApp to establish a connection to TWS via the API.
  • Read-Only API (leave unchecked)
    OptionsApp must not only read data from TWS, but also be able to submit and manage orders.
  • Socket Port
    The Socket Port must match the port entered in OptionsApp.
    The connection between TWS and OptionsApp can only be established if both values are identical.
  • Expose entire trading schedule to the API (check the box)
    This setting ensures that complete trade executions are transmitted correctly to OptionsApp.
  • Master API Client ID (enter the value 0)
    As a result, the API connection of OptionsApp is correctly treated as the master connection, which supports the assignment of orders and positions.
  • Allow connections from localhost only (check the box)
    This setting increases security by only allowing API connections from the same computer.

4. API Precautions

The following API precautions must be set:

  • Bypass Order Precautions for API Orders (check the box)
    This suppresses general warning messages when orders are submitted via the API.
  • Bypass Redirect Order warning for Stock API orders (check the box)
    This setting prevents unnecessary warning messages when stock orders are redirected.
  • Bypass No Overfill Protection precaution for destinations where implied natively (check the box)
    This suppresses warning messages if the protection function in question is already handled natively at the destination market.

The following configuration is recommended for most installations:

  • Host: leave unchanged if TWS and OptionsApp run on the same computer
  • Client-ID: 0
  • Port: identical to the TWS Socket Port
  • Timezone: US/Eastern
  • Market Data Lines: 100
  • ActiveX and Socket Clients: enabled
  • Read-Only API: disabled
  • Expose entire trading schedule to the API: enabled
  • Master API Client ID: 0
  • Allow connections from localhost only: enabled
  • API Precautions: enabled

6. Important Notes

After changes to the API or connection settings, TWS and OptionsApp must be fully restarted for all adjustments to take effect.

In particular, Port, Client-ID and time zone must be configured consistently in OptionsApp and TWS.

Depending on the TWS version, the order or naming of individual settings may differ.

The line "Manual orders on managed contracts" in this settings block refers to a rule: No manual orders may be placed in TWS on contracts that belong to a running OptionsApp trade. What OptionsApp does and does not do in such a case is described in Manual orders on contracts managed by OptionsApp.

Was this article helpful?