Interactive Brokers A.P.I.

Henry, JT,

I've just installed the API, as my current scheme is really only going to be tradeable with a degree of automation. I'm looking at the C++ sample code, which looks like a good start. However, what I can't find is any sort of overview which would help put things in context. For example, if I'm wanting to track tick data, or say 1 min bars, do I have to keep polling with a data request, or can it be set up to send a data record for each tick, minute etc?

I'm also strugglng a little as I can't find the definitions of some of the abbreviations needed. For example trying to pick up data for the DAX I need to set the type as Future, I presume, but is that FUT, future or what? Are these sorts of things laid out anywhere, or do you just have to guess, ask on the BB etc?
 
OK, Having delved into my TSim contracts file I've got the detail I need to get it going, and I can see that once a request is set up it gets refreshed on each change of the data, neat. All I need to do now is work out how to capture it!

However, any pointers to additional help and information sources on the API would still be appreciated.
 
Hi Peter,

Once you have connected to TWS, you chose the market data you want in the IB format (like Seirra with IB). All ticks are then automatically forwarded to your app as an event. You bascially modify all these handlers.

Yes you have to make your own bar data, again not difficult.

Compile the sample code and run it to get a feel. A man with your C++ skills will walk it.

Ifs there is any thing specific you want to know then please ask.

JonnyT
 
JT.

I've just been playing with it a bit, and I've now worked out where the handlers for the incoming tick data are, so hopefully I'll be able to do something useful tomorrow!

Thanks, I'll be in touch if I get stuck.
 
mmillar said:
JonnyT - so when you say CCI doesn't work, you have actually programmed a CCI indicator in Excel? that sounds like hard work to me :)

The data has got to get into Excel from somewhere and I'm guessing JT is using Sierra in which case the CCI and any other indicator will be there readily available for him to use in his VBA code. That's certainly the way I've always done my backtesting anyway - cheap and cheerful :)

H.
 
JonnyT, Henry, GreyingSurfer,

For the second time today I am totally confused. You'll have to excuse my ignorance of these matters - I can write simple backtesting code but haven't ventured into more complex programming ...

My assumption (which now seems wrong) was that you pulled a flat file with a complete history of a symbol into Excel and then processed it with VBA. Now you have included SierraChart. How, exactly, does the process work? I don't think this has ever been discussed before in detail and I'm extremely interested. :)

Thanks

mmillar
 
Hi mmillar,

The data is pulled from seirra chart in excel format.

You basically set up a chart with your instrument, any indicators, any timeframe.

That data can then be exported and backtested using VBA in excel. i.e. no need to calculate bars, indicators, MAs etc etc.

HTH

JonnyT
 
Aha! I didn't realise that SierraChart had that Excel functionality. It all makes sense now.

Thanks.
 
Really interesting thread folks, am keen on connecting to IB for tick data for testing purposes but a bit sad by Henry's comment that the data will be unreliable. Though should have expected this as most test systems are run this way. The LSE system before SETS was pretty good but most other exchange systems are pretty naff.

I have intra day bar data from a couple of sources for some back testing but will need a real time feed once I am closer to going live. What are peoples views of the tick data from IB ? Is the feed reliable, am interested in US stocks initially. I have a lot of experience coding against Reuters feeds but am unclear how IB will compare in terms of performance. Will try and hook up some code to the IB demo system just to see how the API works. Will be writing in C++ under BCB6 but might be able to share some code with others.

Cheers

Mac
 
theknifemac said:
a bit sad by Henry's comment that the data will be unreliable.

Mac,

Henry's comment was about the demo data, which is pure rubbish, but still useful for checking out that your buy and sell buttons work in the right order before you try for real :cheesy:

The real data you get if you have an account with IB is excellent. I find them a lot more reliable than MyTrack, though, of course, they don't have historical data.
 
Peter

Understood. I just wondered about the quality of the data, I was thinking that eSignal was also a data provider but I guess people are using them for TA and historic data.

Will give the API a go when I get some free time. Opening a full IB account could be troublesome for me right now as I work for a bank and they do not allow us to trade away ;-<

Mac
 
hi

does anyone know how to place (manual) trades in TStation that can be sent to IB? Is there a custom API out there? I could use Ninja but its more monthly software fees and another data (IB) feed slowing my connection.

cheers
 
24/5 automated trading with IB

How to achieve automated trading with Interactive Brokers since:
- it is needed to have TWS client be opened when using TWS API
- TWS client has Auto logoff function which cannot be disabled! - this is curious since my automated strategy must run 24/5

Are there more professional solutions for automated trading with IB?
 
I am really intrested in using IB's API. Even i have already tried to use this on Excel but really did'nt understand all the functioallities. If somebody have a knowledge of that plz share with me i will be very thank full to him.
[email protected]
9910221403
 
We built an algo/automated trading system in VC C++ utilizing the API. The hardest thing to implement is an OMS and the actual strategies.We've implemented the well known indicators(RSi etc), a few of our own, chart pattern recongition, weighting, time intervals etc. IB is reliable, and the mkt data is good. You have access to many exchanges and asset classes. Thumbs up to IB. You can also trade via FIX with them.
 
Last edited:
hi jonny
i am also trying to use this api
but i am having my tws on a remote location (remote ip)...
if i am giving that remote ip to connecting through IB,this is showing an error
that connection is not established because of host is not repoding

please help me out

thanks
It is true my leige, I have automated trading through IBs API.

Its very simple if I can do it.

Step 1 is to download the API from IB
Step 2 is to install the API
Step 3 is to look at the sample code installed in c:\Jts
Step 4 is to decide whether to use Excel, C++ or Java (I chose Java for the challenge)
Step 5 is to obtain a compiler oe MS Excel (I use Suns free Forte Java development tool)
Step 6 is to hack the sample code into what you want
Step 7 is to use IBs API forum for any required advice on the API
Step 8 is to be aware that updates to TWS or the API can do many strange things with your application
Step 9 is play golf whilst your system autotrades profitably for you
Step 10 is to retire to the sun.

I'm currently on step -1, Bankrupt quicker than I imagined possible.

JonnyT
 
Top