What DLL functions are available in IB-Plugin?

IBPlugin is further development of TWSLink.It is focused for the useage with MetaTrader. But as it is a DLL, you can use it everywhere on Windows which supports DLL, e.g. in Trade Station or C++ applications or make wrapper for Perl, Python etc.

Users who just registered, please write an email to
forum@trade-commander.de
with your username mentioned.
So we can distinguish you from bots.
Thank you
Post Reply
Zebra25
Posts: 1
Joined: Tue Oct 19, 2021 10:53 pm

What DLL functions are available in IB-Plugin?

Post by Zebra25 »

Dear Sir/Madam,

We have been using TWS-Link for many years with Interactive Brokers (and TradeStation platform) to do automated futures trading.

We are considering upgrading to IB-Plugin but we need IB-Plugin to provide the same DLL functions as TWS-Link?

The TWS-Link functions we are currently using are as follows:

DefineDLLFunc: "TWSLINK2.DLL",int,"REGISTER_CONTRACT",LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,double,LPSTR,int,double;

DefineDLLFunc: "TWSLINK2.DLL",int,"PLACE_ORDER",int,int,LPSTR,LPSTR,int,double,double,LPSTR,int,int;

DefineDLLFunc: "TWSLINK2.DLL",int,"SET_FA_MEMBERS",int,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,int;

DefineDLLFunc: "TWSLINK2.DLL",int,"CANCEL_ORDER",int,int,LPSTR,int,LPSTR;

DefineDLLFunc: "TWSLINK2.DLL",LPSTR,"GET_ACC_VAL",int,LPSTR,LPSTR,int;

DefineDLLFunc: "TWSLINK2.DLL",double,"GET_POSITIONS",int,LPSTR;

DefineDLLFunc: "TWSLINK2.DLL",int,"CONNECT",LPSTR,int,int,int;

DefineDLLFunc: "TWSLINK2.DLL",int,"GET_ORDER_STATUS",int;

Are the above eight (8) TWS-Link DLL functions also offered in IB-Plugin?

Look forward to your reply.

Kind regards,

Rod Fraser

board_admin
Site Admin
Posts: 244
Joined: Mon Apr 24, 2017 3:24 pm

Re: What DLL functions are available in IB-Plugin?

Post by board_admin »

Best TS/MC tutorial for using IBPlugin is the video discussing example:
https://youtu.be/lH3GE_pDm48?list=PLYD3 ... dcECuxa954

Find the example attached (which is also installed along with IBPlugin)

- REGISTER_CONTRACT
no longer required. As contract id you are using the IBKR conid (unique contract id).

-PLACE_ORDER
ibgORDER_SEND (int connid, int uidc, string action, string otype,int size,double price, double stplmt,double stoploss,double takeprofit, string comment,int id_allocation)
or
ibgORDER_SEND_STR(int connid, int uidc, __int64 uid, string order_attrib_list, int id_allocation)

Note: both functions return a 64 signed integer. This could be a problem in TS/MC.
Use a double instead. In my example this seem to work.

-SET_FA_MEMBERS
int allocid=ibgCREATE_ALLOCATION (int connid, string alloc_type,string alloc_name, string alloc_method, string percentage);
Use the returned id in ibgORDER_SEND...

-CANCEL_ORDER
ibgORDER_DELETE

-GET_ACC_VAL
double __stdcall ibgACCOUNT_INFO (int connid,int idinfo, string account_list);
(mind example: make a snapshot, then cycle over values)

-GET_POSITIONS
double __stdcall ibgPORTFOLIO_INFO(int connid, int uidc, int idportval, string account_list,int aggregate_unsigned);
(mind example: make a snapshot, then cycle over values)

-CONNECT
int __stdcall ibgCONNECT (int connid,string ip,int port,int clientid, int nbr_channels,int timeout);

-GET_ORDER_STATUS
ibgORDER_STATUS
Attachments
ibplugin_demo.zip
(3.42 KiB) Downloaded 714 times

Post Reply