IB API

234 views
Skip to first unread message

Dmitry Shevkoplyas

unread,
Oct 26, 2013, 1:36:54 AM10/26/13
to tradeli...@googlegroups.com
hi all,

I've few notes on the subject:

Today is 26-Oct-2013.
Latest IB API is available on IB site here: http://interactivebrokers.github.io/#

Version: API 9.69
Release Date: July 1 2012
filename: TWS API Install 969.03.msi

This installer (among other things) will install: TwsSocketClient.dll v.9.6.9.0 into: C:\Windows\SysWOW64 (on windows 7 Pro)

Now if we look into tradelink r.3754 (latest) it also has TwsSocketClient.dll v.9.5.1.0 (older, than official IB "latest stable" dll version)

So, there should be a process of updating TwsSocketClient.dll for tradelink:
- with easily runnable test cases
- with some analysis on how the new TwsSocketClient.dll can affect existing tradelink API talking to TwsSocketClient.dll
- older versions should be preserved (in case new one is not working with tradelink "out of the box", so we can temporarily roll back to what's working

Also:
The whole TWSServer project should be documented.
IB API should be carefully studied.
IB API <--> Tradelink API communication should be "well known" to tradelink developers.
IB API <--> Tradelink API communication:
- must be easily visible (debug level > 1 should lead to more verbose messages)
- any communication issues must be easily visible via some means (errors, alerts, logs etc.)

Other notes:

[Q] How to see contents of windows library?
(quote)
DUMPBIN /SYMBOLS shows the functions and data objects in the library. If you're talking about a import library (a .lib used to refer to symbols exported from a DLL), then you want DUMPBIN /EXPORTS.
Note that for functions linked with the "C" binary interface, this still won't get you return values, parameters, or calling convention. That information isn't encoded in the LIB at all; you have to know that ahead of time (via prototypes in header files, for example) in order to call them correctly.
For functions linked with the C++ binary interface, the calling convention and arguments are encoded in the exported name of the function (also called "name mangling"). DUMPBIN /SYMBOLS will show you both the "mangled" function name as well as the decoded set of parameters.
...
tool like ar t libfile.a in unix.
The windows equivalent is lib.exe /list libfile.lib
...
both DUMPBIN and LIB.EXE can be started on windows using:
Microsoft Visual Studio 2012 -> Visual Studio Tools -> VS2012 x86 Native Tools Command Prompt
(end of quote)

[Q] How to link to TWS using the TwsSocketClient dll
(quote)
To link to TWS using the TwsSocketClient.dll

1. Create a Windows application using MS Visual Studio (version 5.0 or higher).
2. Add C :\jts\SocketClient\include to your project's include path.  This should be done for any individual project that accesses the TwsSocketClient library's header files.
3. Add the C :\jts\SocketClient\lib\TwsSocketclient.lib file to your project's libraries path.  This should be done for any individual project that accesses the TwsSocketClient library.
4. Include EWrapper.h and EClientSocket.h in any Visual C++ source code that accesses their functionality and data structures.
5. Subclass the EWrapper class.
6. Override the following functions:
- Override tickPrice() and tickSize() functions to handle the market data.
- Override the orderStatus() function to receive order status.
- Override the error() and winError() functions to receive error information.
- Override the connectionsClosed() function to be notified when TWS terminates the connection.

7. Instantiate the EClientSocket class.
8. Call the following functions:
- Call the connect() function to connect to TWS.
- Call the reqMktData() function to request market data.
- Call the placeOrder() function to place an order.
- Call the checkMessages() function frequently (every 1 second) to process data received from TWS.
- Call the reqOpenOrders() function to request open orders.
- Call the reqAccountUpdates() function to request account data.

To run the program, ensure that the TwsSocketClient.dll is in the same directory as your executable, or in your path. By default, the TwsSocketClient.dll file installs into your C:\Windows\system or C:\WINNT\system32 directory.
(end of quote)

Does anyone on this list is ready for some heavy lifting, heh?  ;)

ps: also tried to attach file:
API Reference Guide October 2013 Updated through API Release 9.70.pdf
, but it didn't come through due to size limits (11Mb). All messages must be less than 8.00 MBytes.

-- 
с ч.гл.ув.,
Дима Ш.

Getting Started with the TWS C++ API September 2013 Supports TWS API Release 9.69.pdf
Reply all
Reply to author
Forward
0 new messages