MetaTrader-Interactive Brokers Order Copier New Version

Release Notes:

  • Important change: The working folder changed from users/<username>/documents/
    This is because of too many problems with MS OneDrive and/or arabic, hebrew,etc. language codes.
    The location in c:\ is the most safe and easy to find and to delete in case of uninstallation.

For users with no problems, this update is not required. But future updates will use new location. When you want to migrate, just do the following steps:

1. Install the new version.
2. Goto users/<username>/ and copy folder     mtib_order_copier
Confirm overwrite.

Or request help:

Goto Product Page

Download MetaTrader - Interactive Brokers Order Copier




MetaTrader-Interactive Brokers Order Copier New Version

Release Notes:

  • Bugfixes: MetaTrader 5  Netting Account:  Changing Position size did not adjust bracket order size
  • Changes: MetaTrader 5 Netting Account: A position now has only one bracket order. So multiple stoploss- and takeprofit orders are summarized in one bracket like on MetaTrader 5.
  • Optimization of reconnection procedure.


Goto Product Page

Download MetaTrader - Interactive Brokers Order Copier




IBPlugin New Version

This new version comes with some bugfixes and has also a new expert for manual traders, the:

IB Position Sizer


This expert calculates order volume based on fix stoploss or calculates stoploss, based on fixed order volume.

This is dones based on a custom defined risk in % and the current InteractiveBrokers account balance (CASH value).

Alle Berechnungen basierem auf eurem InteractiveBrokers Konto, im Speziellen, der Balance (CASH Wert).

Also this expert is a free addon for IBPlugin. You can change the sourcecode and you can sell it.

It never been so easy to trade an InteractiveBrokers account from within MetaTrader charts.

Download Setup file: ibpluginSetup


TradeStation, Multicharts Example placing a Vwap order on an InteractiveBrokers account using IBPlugin

// This signal demonstrates the use of IBPlugin to trade an IBKR account
// from within MultiCharts or TradeStation.
// The signal just connects to TWS/Gateway (watch port,IP)
// places a Vwap orders, waits 5 seconds and cancels this order
// --- declare dll functions ---
external: "ibplugin.dll", int, "mtibTS_ON_CREATE", IEasyLanguageObject;

external: "ibplugin.dll", int, "mtibTS_ON_DESTROY", IEasyLanguageObject;

DefineDLLFunc: "ibplugin.DLL",int, "mtibINIT_SCRIPT_A",

DefineDLLFunc: "ibplugin.DLL",int, "mtibDEINIT_SCRIPT";

DefineDLLFunc: "ibplugin.DLL",int, "mtibCONNECT_A",
DefineDLLFunc: "ibplugin.DLL",int, "mtibCONNECTION_STATUS",
DefineDLLFunc: "ibplugin.DLL",int64, "mtibORDER_SEND_STR_A",

DefineDLLFunc: "ibplugin.DLL",int, "mtibORDER_DELETE",

DefineDLLFunc: "ibplugin.DLL",int, "mtibSLEEP",
     conid_intel(270639),         {IBKR unique id for intel}
     port(7497),                 {API port of TWS or Gateway. Make sure API is on. Active X enabled, port same as here..}
     connection_id(1),             {ID of connection}
     order_attribute_str(""),    {list of attrib=value pairs as order attributes}
     algo_param_str(""),        {list of attrib=value pairs as algo param (Vwap is algo order)}
     uid_order(0),            {unique id of order}

     int_ret(0),                {int return value}
     Initialized(0);            {init flag flag}

{ DLL initialisation}

    {init the DLL }
if Initialized = 0  then begin

    {connect to TWS / Gateway at standard port. make sure TWS or Gateway are setup to operate with API clients such as ibplugin  (}
    // algo param pair sep char "|"    
    // algo param value assign char "~"
    // So an algo argument is defined by a string concatenation of id1~value1|id2~value2|id3~value3... and so on;how many attributes your algo requires

    // create the Vwap algo param string. The challenge: User need to figure out what parameters required for his algo order (
    algo_param_str="noTakeLiq~1"; // human say: noTakeLiq=1 (the ~ is used as assginment charactar within algo param definition)

    Print(    algo_param_str);    
    // order attrib pair sep char "#"
    // order attrib value assign char "="
    // So an order is defined by a string concatenation of id1=value1#id2=value2#id3=value3... and so on;how many attributes your order requires
    // create order attributes. The <algo_param_str> is such an attribute
    // the algo name (the 69 is the order attribute id.     
    order_attribute_str = "69=Vwap"; // algo name    
    // attribute separator and algo param id
    order_attribute_str += "#70=";
    order_attribute_str += algo_param_str;

    // action attribute    
    order_attribute_str += "#53=BUY";

    // type attribute    
    order_attribute_str += "#6=LMT";

    // exchange attribute    
    order_attribute_str += "#1007=SMART";

    // limit price attribute
    order_attribute_str += "#2=44.84";

    // outside RTH atribute (only false)
    order_attribute_str += "#14=0";

    // time in force attribute (only day accepted)
    order_attribute_str += "#5=DAY";

    // ordersize
    order_attribute_str += "#1=100";
    Print("connection status",mtibCONNECTION_STATUS(connection_id));
    Print(    order_attribute_str);
    { Finally place order }
    uid_order=mtibORDER_SEND_STR_A(connection_id,conid_intel, 0,     order_attribute_str,0,0);
    Print("uid=",    uid_order);

    // wait 5 seconds
    // cancel (delete) order async
    Print("cancel ret=",    int_ret);

    OnCreate =     mtibTS_ON_CREATE;
    OnDestroy = mtibTS_ON_DESTROY;

IBPlugin New Version

New Version of IBPlugin has been released. Besides minor bugfixing it contains an example for use with MultiCharts or TradeStation.

After installation can be found under:
C:\Program Files\\IBPlugin\multicharts

Download Setup file: ibpluginSetup


What is IBPlugin ?
IBlugin is a plugin for Windows applications to trade an InteractiveBrokers account.

It contains examples how to use it with MetaTrader 4/5 (MT-IB Trade Panel) and this new version also an example (Signal) how to use with MultiCharts or TradeStation.


Question: Can IBPlugin feed MetaTrader charts with IBKR market data ?

No. This is not possible at all. Click link for more information.