Loading...
 

Technology Provider: Interactive Brokers (en)

 

Brief overview of Interactive Brokers (IB)

Interactive Brokers is a well-known company that has provided financial services as a broker and dealer since 1977. Essentially, IB specializes in intraday and institutional trading. The company developed its own trading platform - Trading Work Station (TWS) - and offers traders very advantageous commission and margin.


Supported asset classes: CFD's, Future, Forex, Index, Stock


Supported orders:

OCO order connections are supported by this broker
ORO order connections are locally simulated
IFDone order connections are locally simulated


Order execution
AgenaTrader does not execute any orders! Instead, brokers simply inform us of filled orders and execution price.
If data received from your data feed provider does not match the quotes on the brokerage platform for an instrument,
then the entry and exit price will not be displayed properly on your chart.


You can open a real or demo account at Interactive Brokers via our website

Supported Account Types by AgenaTrader

  • Standard Single Account (One Login and one connected main account)
  • Financial Advicer (FA) Accounts (One Login with a main account and several sub-accounts), find more details HERE
  • Family and Friends (F) Accounts (One Login with a main accout and several sub-accounts), find more details HERE

Not supported Account Types by AgenaTrader

  • Duplicated Accounts (One Login and several connected main accounts)

(This Account Type is not supported and can lead to problems with order executions and data synchronization between TWS and AgenaTrader. Please contact your IB Account-Manager to change your Account to one of the above mentioned supported Account Types.)

 

Connecting

Please follow the instructions in the following video to establish the connection correctly:

Essential information

Message "The registration key for 'Trader Workstation' could not be found"
This message appears if the API settings have not been set for TWS according to the Connection Guide (see table above).
Additional information about brokers can be found on our website.

Also make sure that the file tws.exe is installed in the main directory "Jts". If a sub directory was created than this file with all the other files must be moved to the main directory. Only than AgenaTrader can autostart the TWS.

Port settings


Port settings in TWS and AgenaTrader must be synchronized if connection issues are experienced. That means, ports need to have the same number

IB Port  

Please use following ports:
7497 - Demo account
7496 - Live account

 

For details please download IB Host and Ports Documentation file.

 

Automated Reconnection


AgenaTrader has an implemented logic which automatically reconnects if the connection was lost without means. If you use a VPS server and the Windows Remote Desktop software this logic can have problems because when the Windows Remote Desktop was closed all the Windows function for starting programs are locked and the reconnection process cannot be established. Please use other Remote Software tools like Teamviewer or Anydesk.

 

Client ID


In some cases user can get notification: 

IB Notification  

It means ClientID in AT and TWS differs. ClientID must be synchronous between AT and TWS, as otherwise information is not transmitted correctly to the AT.
To avoid this User should synchronize the ClientIDs because of the two attachments, or set them to 0 in AT and delete them in the TWS.
IB Client  

 

IB as a data feed

Historical Request Overflow

The maximum number of simultaneous open historical data requests from the API is 50. So you should take care that you have a much smaller number of requests pending at a time.

Pacing Violations for Small Bars (30 secs or less)
A Pacing Violation occurs whenever you do not observe one or more of the following restriction:
-> Making identical historical data requests within 15 seconds.
-> Making six or more historical data requests for the same Contract, Exchange and Tick Type within two seconds.
-> Making more than 60 requests within any ten minute period.

However, be careful when requesting large amounts of historical data or sending historical data requests as "soft limit' is still implemented. If you request too much of historical data you will get disconnected from API client. You can find further information about the pacing violations for small bars in this IB article.
Please note:

1 instrument in 3 timeframes = 3 histories
1 Analyzer Escort column = 1 history
Watch lists, backtest lists, indicators and alerts also require histories.


2 6 2017 12 15 58 PM For each Trade/Order running in TWS will require corresponding L1 + Option subscriptions and could cause 'overload.

Limitation

For each bar size AgenaTrader provide historical data for the limited period of time.


Please see table below:

Bar Size Time Period
1 - 4 sec bars 30 min back
5 - 9 sec bars 1 h back
10 -29 sec bars 4 h back
30 - 59 sec 8 h back
1 min 1 day back
2 min 2 days back
3 - 29 min 1 week back
30 m - 1439 min 1 month back
1-23 h 1 month back
EoD (1 Day) 1 year back

 

Futures Contracts

The IB API does not support Continuous Contracts. This means that AgenaTrader can only show one Contract e.g. FrontMonth.
In order to compare the data in TWS with AgenaTrader please do not use Continuous Contracts.

Supported Time Zones

 

Time Zone Description
GMT Greenwich Mean Time
EST Eastern Standard Time
MST Mountain Standard Time
PST Pacific Standard Time
AST Atlantic Standard Time
JST Japan Standard Time
AET Australian Standard Time

 

Please download API Reference Guide.pdf  file. Time zones section in Chapter 9, page 571

 

Delayed data

A market data subscription is required to receive historical data from the IB-API. This means that if delayed data is delivered to you, AgenaTrader will not be able to display charts.

 

Differently displayed charts in AgenaTrader and the TWS


We do not receive tick date through the current IB-API. As a result, some ticks may be assigned to the previous or the subsequent bar.
This applies especially to computers with an incorrect system time. AgenaTrader attempts to solve this problem via system time synchronization

 

Multi Accounts


Multi accounts are not supported by AT. During connection user would get warning message in log:
"Your account type: Multi Accounts is not supported. The connection is possible but we noticed minor problems." 

 

Fees included in the price


Interactive Brokers includes fees in the price of an entry order, which is displayed on the chart as follows: entry price = order price + commission.
Displayed within short time frames and small positions, this entry price may be confusing.
However, AgenaTrader is unable to separate commissions from the order price, since we receive pre-assembled data via the API.

We plan to fix this problem by allowing traders to manually enter the exact numbers from your broker in the Profit & Loss, Commissions, and other columns.
This functionality will be implemented in one of the upcoming AgenaTrader versions.

Please refer to your broker if you wish to know the exact sum of the profits, losses or commissions.

 

Profit & Loss: differences between AgenaTrader and TWS


AgenaTrader and TWS calculate PL in different ways. So results may be differ: Agena Fehler Screenshot   
Please see the currency conversions section for more information.

 

If the user would have quotes in pennies or USD cents in AT it would be shown in GBP or USD (100x more).

Instruments with such quotes:

CT Cotton
GF Feeder Cattle Futures
HE Lean Hog Futures
LE Live Cattle
ZL Soybean Oil Futures
ZO Oat Futures
ZR Rough Rice Futures
ZS Soybean Futures
ZW Wheat Futures
XK MINI SIZED SOYBEAN FUTURES
CT.I Cotton No. 2
DPW.L DP WORLD LIMITED ORD USD2 (DI)
ZC Corn Futures

 

Error messages from Interactive Brokers


IB

Please contact the IB support team to clarify.
Note: The error messages received from Interactive Brokers are not errors in the ordinary sense, but simply IB internal codes that serve informational purposes only. You can find an interpretation of all Interactive Brokers codes here

110 - The price does not conform to the minimum price variation for this contract.
AgenaTrader solution: adjust tick size to tick size set in TWS

200 - No security definition has been found for the request. 
AgenaTrader solution: import of mappings or manually adding the correct mapping in Instrument Escort.

Order size exceeds leveraged FX-Position.
AgenaTrader solution: decrease order size or increase account size 

Arz  Importat! If user trades instrument which can be executed on the different exchanges, he will get the specific message in log. For example, if user places order BMW.FF (Frankfurt exchange)and this order is executed on BMW.DE (Xetra exchange) user will get following message in log:


"Your orders to BMW.FF are resolved to primary exchange which is located on different instrument - BMW.DE"

 

Adjusting the tick size for CFDs according to the current price__


Please note that Interactive Brokers uses different tick size parameters according to the particular price range. When trading some European CFDs, it may occur that users receive the following error messages:
1. "The price does not conform to the minimum price variation for the contract".
2. "Instrument Tick-Size is not zet calculated or delivered".
In order to continue the trade it is necessary to adjust the tick size for the instrument manually.

Please enter a ticker name in the search field on IB's website and check the price parameters for the selected instrument. 

Zurn IB

Then enter the tick size in the Instruments window according the the current price, and check the checkbox Pin Tick Size as shown in the figure below:

Zurn IB Instrument

 

Gateway


Please find a connection-guide for IB-Gateway HERE

 

Financial adviser account from Intercative Brokers


Please find a connection-guide for IB-FA Accounts HERE
 

Assigning instruments and orders with Interactive Brokers

 

"Resolve position instrument" popup or "Resolve instruments for orders" popup

From time to time it may occur that an order with Interactive Brokers cannot be assigned to the appropriate AgenaTrader instrument.
The reason for this is that Interactive Brokers uses the same symbol name for different instruments.
For example, the stock with the Interactive Brokers symbol „AAPL“ is listed on the NASDAQ as well as on the XETRA exchange. AgenaTrader uses the name "AAPL" for the NASDAQ instrument and the name "AAPL.DE" for the XETRA instrument.

Depending upon which exchange you are trading with, it may become necessary to manually assign an order to the correct AgenaTrader instrument.
Although AgenaTrader has integrated a process that assures that symbols are correctly accounted for, it does not work if an order is entered directly in the TWS.

Should this happen, the "Resolve position instrument" popup will appear, instructing you to assign the correct instrument in AgenaTrader for the Interactive Brokers order.

Using the example of the AAPL stock:

  • shares traded with NASDAQ are assigned to the AgenaTrader instrument "AAPL", and
  • shares traded with XETRA are assigned to the AgenaTrader instrument "APC.DE".

ResolveInstrument1

 

Symbol entry in the TWS (example: AAPL)

AAPL TWS  

Resolve   

AgenaTrader++ (plusplus) Resolve Setup

This is one of the essential tools in AT++.

AgenaTrader++ (plusplus) resolve setup works in the following manner:

  • If you have submitted and confirmed orders, AgenaTrader++ strategies will continue to run even when the trading platform is closed.
  • These strategies will be saved within the system.
  • When you start AgenaTrader up again, the strategies will be adjusted to the current market conditions.

If you plan to keep an intraday trade with the AT++ setup overnight, we recommend that you do not turn off AgenaTrader since this can lead to unexpected order behavior.
For example, order groups managed by AgenaTrader, such as IfDone and OCO, are often not linked to your broker due to the fact that the majority of brokers do not support these special types of orders. Only having AT opened ensures that all setups and functionalities will remain unchangeable.

If something happens during the time in which AgenaTrader is closed (e.g. filled or cancelled orders, closed trades etc.), stops will be recalculated and positions/setups will be adjusted etc. Obviously, this can be dangerous.

Should this occur, you will receive a recovery popup (see image below) displaying the trades which require your intervention and supervision:

Resolve

Functions of the buttons in the recovery popup:

  • The Entry Escort button allows you to enter the strategy. NOTE: the Trades tab will display the entry reason.
  • The button Session allows user to select analyzer session
  • The Confirm button applies the suggested actions.
  • Chart area provides you access to all chart function. Details on section Chart Toolbar

If you close the popup without confirmation, you will have to clear the trades manually.

 
Arz Important!


For some Symbols TWS don't allow to place limit order outside trading hours

2 6 2017 12 15 58 PM

Important Note


THE BROKER'S PLATFORM ALWAYS REPRESENTS THE REFERENCE PLATFORM.

This means that the orders and market-related values shown on the BROKER platform are valid. 
The broker's platform should always be active as a backup to AgenaTrader. 
This gives you an essential overview of the interaction between AgenaTrader and your broker. 
Furthermore, you will always know exactly how your orders/positions and ultimately your account balance are displayed.

 

Search AgenaTrader Wiki

Switch Language