Bugfix: MT4 only. Reopen of MT4 opened positions when restarting copier and MetaTrader.
Author: chinaski
MTIB Order Copier new Version: 2.9.7.7
- Autoroll feature for future (FUT) contracts added.
To set autoroll feature, doublick on IBKR symbol on page Contract Setup. Set the # of days before expiry for autoroll. If you want to manually roll contract, Click on button Roll contract.
IBPlugin new version 1511
Hello community,
there is a new IBPlugin version 1511.
Product Page:
Download Link
Release Notes:
Changes:
– IBPlugin is now capable to query contract data and to save a contract from query result along with unique custom symbol
name to database, so you can get conid/uidc from function
[code]ibgNAME_TO_UID(“my_unique_symbol_name”)[/code]
Similar to position data, the query creates a snapshot list with affected contract and returns the number of contracts.
MetaTrader code snippet:
// ——————————————–
// [#8] Do a contract query:
Print(“+++ contract query START”);
// create a snapshot of all HE FUT contracts. Timeout 5 seconds
total_objects=ibgCONTRACT_QUERY(“UDL=HE#SET=FUT”,5000);
Print(“##contracts=”,total_objects );
// list all returned contracts with symbol and conid
for(int idx=0;idx < total_objects;++idx)
{
// file:///C:/Program%20Files/trade-commander.com/IBPlugin/documentation/tbl_symbol_info.html
int uid = ibgCONTRACT_INFO_INT(idx, 7);
string symbol = ibgCONTRACT_INFO_STR(idx, 8);
// if this is the contract you are looking for, use
// this function to add it to internal database along
// with unique symbol name
// uid = ibgADD_CONTRACT_IDX( idx, “my_unique_symbol_name”);
// so you can access contract
// by calling function:
// ibgNAME_TO_UID(“my_unique_symbol_name”);
PrintFormat(“[%d] symbol=%s uidc=%d”,idx,symbol,uid);
}
Print(“— contract query END”);
– Market data request and access extended.
The market data request allows generic ticks argument.
It is now possible to retrieve Option data, like delta, vega, etc. , tick EFP, tick generic, tick string.
Market data are stored in circular arrays. So there is a certain tick history store during runtime and can be accessed by index, where
index=0 denotes latest tick.
TradeStation / MultiCharts code snippet:
// subscribe to realtime data
ticker= ibgSUBSCRIBE_REALTIME_DATA(connection_id, conid, “”, “”);
ibgSLEEP(2000);
For idx = 200 to 207 begin
// subtype identifier (idx)
// —————————
//implied_vola=200
//delta=201
//opt_price=202
//pv_dividend=203
//gamma=204
//vega=205
//theta=206
//und_price=207
option_value=ibgGET_REALTIME_DATA(connection_id, ticker, 21, idx, 0);
Print(“option-val[“,idx,”]=”,option_value);
Recommended TWS Version for trade-commander.com products
Unlike recommended in a prior post, it is best practise to stick always
with InteractiveBrokers time tested version (download lower right “TWS Offline-Version”). Currently this is version 981.xx.
Some users report problems using newer TWS like the version above.
For instance, the MTIB Order Copier never completes connection.
If you have this problem, go to API settings in TWS / Gateway and
follow this procedure:
– Uncheck “Allow connections…”.
– Reconnect trade-commander.com software with TWS / Gateway
– When asked to accept connection from (name)/ip, note the IP
then create a Trusted IP and just put IP (name excluded) in.
– Save
– When the trade-commander.com software conencts next time, it should
work without the need to confirm connection.
MetaTrader-InteractiveOrder Copier Problems with actual TWS
The MetaTrader-InteractiveBrokers Order Copier works not with the current time tested Version of TWS / Gateway. This is verison 978.
We ask our customers to stick with previou time tested Version, which is
978.
MetaTrader and Interactive Brokers
We often get requests to connect MetaTrader with InteractiveBrokers (IBKR).
Poeple expect to login into their IBKR account using MetaTrader 4/5.
This is not possible. MetaTrader is not designed for this.
Also feeding MetaTrader charts with external market data, like
IBKR quotes, is not possible.
Also JTWSData can not do this. You can create your own MT symbol (custom symbol) and then use JTWSData to feed with IBKR market data
, even realtime but you won’t be able to place an order for such symbol.
Why not ?
Because the MetaTrader design is a closed concept: You can only trade with
MetaTrader Broker you are connected to by MT login. This MetaTrader broker has
its own tradeble symbols.
A custom symbol belongs not to this list.
MetaTrader brokers need control about market data for their business
concept. This is how they make money. So they won’t allow to trade symbols,
which they do not control.
The good news: You can even use MT4/MT5 to trade an IBKR account: Explainer Video how to
Short Video Tutorial about API Setup of Traders Workstation / Gateway
Counter for Googol (very large) numbers
Sam Battle, Musiker, Make, YouTuber create a counter for very very large (Googol) numbers.
This gear is able to count until 10 power 100. Possible takes more time than universe exists. So what. Enjoy:
IBPlugin Version 1503
Changes in this version:
- Bugfix: User comment for order now correctly taken by function ibORDER_SEND
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.
No prior uninstall required