Posted on Leave a comment

IBPlugin Version 1502

Changes of new version:

  • Bugfix: ibgORDER_CLOSE now works runtime persisten.  (Attention: This function can be executed multiple times. IBPlugin does not mind, if you call this function already for a specific order. It just executes an opposite order to the original order and minds allocation.
  • Correction of MetaTrader 4/5 examples: For FA Accounts,  call of ibgCREATE_ALLOCATION is after ibgCONNECT, which is the correct order.
  • ibgWAIT_FOR… – Functions independent from connection ID.
  • New Function: ibgWAIT_FOR_CANCELLED. Wait for cancelled state.
  • New Function: ibgWAIT_FOR_SUBMITTED_MULTI: Wait forsubmitted or filled status of multiple orders.
  • New Function: ibgWAIT_FOR_FILLED_MULTI:
  • Wait for filled status of multiple orders.
  • New Function: ibgWAIT_FOR_CANCELLED_MULTI:
  • Wait for cancelled status of multiple orders.


Download new Version

No prior uninstall required

Posted on Leave a comment

New Video Tutorials about IBPlugin

IBPlugin is a Windows based Binary Plugin – DLL – that can be used with any
Windows application, that can load ordinary DLL.

It makes the use of InteractiveBrokers API easy and straight.

It is the successor of TWSLink, focusing of the most important tasks:

  • Placing, Changing, Deleting, Closing Orders
  • Gettting Account Data Information (Equity, Margin, etc.)
  • Getting Portfolio Information (Position, Average Price)
  • Getting Order Information (Status, Properties,etc.)
  • Getting Execution Information
  • Providing Realtime Market Data: Bid,Last,Ask

There are 3 new Video Tutorials about IBPlugin in the Video Tutorial Playlist:
Installing, Administration, MetaTrader examples-

Please go on Video Tutorial Page and scroll down for the IBPlugin Video Tutorials.

Posted on 4 Comments

MetaTrader (MT) and InteractiveBrokers (IBKR)

MetaTrader (MT) and InteractiveBrokers (IBKR)

Many traders would like to use MetaTrader with an IBKR account. Simply log into MetaTrader,
as in the TWS, having IBKR market data in the charts, as well as see IBKR orders, position and account data.

But unfortunately this is not possible. The MetaTrader concept is closed. It is not meant to be used with other Brokers
than MT Brokers or to feed the charts with external data. There is no data- and Broker API in MetaTrader.

The reason is in the business model of MetaTrader:  MetaTrader broker make money with an artificial spread. This requires
control over the data, so there can be no data interface.

The deal is: You get a free, very powerful software (with a large community) and on top of that free
Market data. To do this, you only trade with a MetaTrader Broker. They charge you via an artificial
Spread. This is also an attractive concept for small order sizes.

Due to the variable spread model, the costs scale with the order size. This is one of the reasons why many traders wish to use
the popular MetaTrader with another broker, such as InteractiveBrokers..


As said, you cannot feed the MT charts with IBKR data and you cannot execute your IBKR orders, have executions-, position- and account
information in the terminal.

However, there is a way to use MetaTrader to trade an InteractiveBrokers account and it is quite convenient. Because it is possible to follow everything that happens in the MT
If, for example, an order is placed manually or by an expert, this event can be detected in the integrated script environment (keyword: .MQL).

This is where the software comes in and has basically 2 solutions to connect the MT with an IBKR account.
For both solutions an existing MetaTrader account is required. This can be a live account, but also a demo account.

Requirement:  MetaTrade Broker Account

MetaQuotes offers a free MetaTrader 5 demo account, with free Forex data and some futures.

There are also brokers who offer a demo account for longer periods of time, e.g. CMC Markets

and others. The Google God will certainly help.

Many customers already have an MT Live account and then apply for an endless demo account.

So far so good. But how is the connection to the IBKR account ?



There are now 2 solutions:
1. The MTIB Copier:

MetaTrader – InteractiveBrokers Order Kopierer

This software copies orders placed in MetaTrader for MT account to the TWS or Gateway.
This is done automatically, without any programming. The software is particularly suitable for commercial
experts whose source code cannot be accessed. If you don’t know what is meant, no big deal.

Even those who act manually can use the copier productively. You can place your orders from the chart as usual
and they are copied for the IBKR account.

The software must be set up once and must always be running when you want to copy orders.

2. The IBPlugin

TradeStation and Interactive Brokers

(Do not be confused by ‘TradeStation’. The IBPlugin can also be used in MetaTrader. The installation includes a MetaTrader example and documentation)

This is a plugin that you load into MetaTrader. It is intended for programmers. The plugin enables .MQL code to directly trade an IBKR account.
Unlike the copier, there is no need to place orders for the MT account. For example, with a Moving Average Crossover, the function:

           long ticket=ibgORDER_SEND(…)

function to send an order for the corresponding account. In the backtest mode, you could use the MetaTrader function

          long ticket=OrderSend(…)

instead of calling and thus have the opportunity to test the expert first.

This way you can make the very powerful MetaTrader available for an IBKR account.

For both solutions applies:
– It is possible to scale up / down the order sizes on IBKR side. This is how you can execute smaller indices on your MetaTrader account
and larger ones in the IBKR account.

– You can connect any MetaTrader symbol to any IBKR contract, whether it makes sense or not. (For example, you could link an MT CFD contract
to one IBKR share).

Any of the above solutions can be tested. For the copier we also offer a free setup help via TeamViewer.
Usually a matter of minutes.

For the plugin, simple examples are also installed. There is also a documentation.

+ You can use MetaTrader for an IBKR account at all
+ lower costs with IBKR
+ You save costs for a data feed, because with MetaTrader
+ All the benefits of an IBKR account (e.g. no dealing desk)

– no native connection to MetaTrader
– no IBKR data in MetaTrader charts
– An additional delay for the copier, because orders must be accepted by MetaTrader Broker before they can be copied: ~ 70 ms.

Posted on Leave a comment

MTIB Order Copier new Version:

  • Unmap expired contracts: This function is linked to a button on contract page. It unmaps all expired contracts, so you can assign their mapped MetaTrader Symbol to newer contracts.
  • Selective order copy: This applies for ib_order_copy: An option has been added: ‘Copy MKT orders only’. If this is enabled, pending orders are ignored
    and only when a position is opened, the MKT for this is copied. You can also disable to copy SL and TP, by set -1 for Default Target Pips and Default Stoploss Pips in Setup / Misc. Settings.
    So the copier only takes action when positions in MT changes. Optional you can also Make a position sync before start copy This is first param of ib_order_copy.
  • Attention for Position Sync.: There seem to be problems with live accounts. It can happen, in particular, when ordersizes too low,
    that positions get accumulated. In any case make sure, that position differences are aboves IBKR minimum. Also consider to enable Account Protection. But it is recommended, not to use position sync.
    As an alternative, you can use ib_order_copy with the new option to copy only positions and even to ignore SL and TP provided by MetaTrader.