MetaTrader-Interactive Brokers Order Copier New Version 2.9.2.5

Release Notes:

  • Important change: The working folder changed from users/<username>/documents/trade-commander.com/mtib_order_copier
    to
    c:/trade-commander.com/mtib_order_copier
    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>/trade-commander.com and copy folder     mtib_order_copier
to
c:\trade-commander.com
Confirm overwrite.

Or request help: contact@trade-commander.de

Goto Product Page

Download MetaTrader - Interactive Brokers Order Copier

 

 

 

MetaTrader-Interactive Brokers Order Copier New Version 2.9.2.1

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 1.0.2.5

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",
                  LPSTR,{metatrader_identifier}
                  LPSTR,{expert_name}
                  int;{loglevel}


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

DefineDLLFunc: "ibplugin.DLL",int, "mtibCONNECT_A",
                  int,{connid}
                  LPSTR,{ip}
                  int,{port}
                  int,{clientid}
                  int,{nbr_channels}
                  int;{timeout}
                  
DefineDLLFunc: "ibplugin.DLL",int, "mtibCONNECTION_STATUS",
                  int;{connid}
                  
                  
DefineDLLFunc: "ibplugin.DLL",int64, "mtibORDER_SEND_STR_A",
                  int,{connid}
                  int,{uidc}
                  int64,{uid}
                  LPSTR,{order_attrib_list}
                  int,{id_allocation}
                  int;{sync}

DefineDLLFunc: "ibplugin.DLL",int, "mtibORDER_DELETE",
                  int,{connid}
                  int64,{uid}
                  int;{sync}

DefineDLLFunc: "ibplugin.DLL",int, "mtibSLEEP",
                  int;{milliseconds}
                                    
Variables:
     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

    //int_ret=mtibINIT_SCRIPT_A("multicharts","ibplugin_demo",3);
    Print("init=",int_ret);
    
    {connect to TWS / Gateway at standard port. make sure TWS or Gateway are setup to operate with API clients such as ibplugin  (http://www.youtube.com/watch?v=53tmypRq5wI)}
    mtibCONNECT_A(connection_id,"",port,1345,1,3000);
    
    // 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 (https://interactivebrokers.github.io/tws-api/algos.html)
    algo_param_str="noTakeLiq~1"; // human say: noTakeLiq=1 (the ~ is used as assginment charactar within algo param definition)
    algo_param_str+="|speedUp~1";
    algo_param_str+="|allowPastEndTime~1";

    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
    mtibSLEEP(5000);
    
    // cancel (delete) order async
    int_ret=mtibORDER_DELETE(connection_id,uid_order,0);
    Print("cancel ret=",    int_ret);
    
    Initialized=1;    
end;

#Events
    OnCreate =     mtibTS_ON_CREATE;
    OnDestroy = mtibTS_ON_DESTROY;
#end

IBPlugin New Version 1.0.2.4

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\trade-commander.com\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.