IB message rate and API/CTCI limits

Discussion in 'Automated Trading' started by marauder, Dec 7, 2010.

  1. marauder


    Hi there,

    first post at ET (meh, it took me some time to locate a serious trading forum like this one, it seems), so a big "HI" to everyone.

    I'm about to switch my trading to IB in 1'5 - 2 months from now, thus I'm gonna code a connection plugin from my custom made ATS to IB.

    Their fees seem fair enough to me, and their API looks just right to my eyes (time will tell whether I made a good DAB choice or not).

    However, there's one thing which I'm not quite sure about: according to IB docs, when you use the API method to connect to their system, a maximum of 50 messages per second is allowed. CTCI, on the other hand, will allow 150 messages per second to be received.

    I've read over there that IB has a 100ms message granularity. I do not know how this translates into real life behaviour (since I've still not tested IB's system), but assuming that such a number is strictly true, then they will send you tick updates every 100ms: put in that way, wouldn't you end up reaching the 50-messages limit pretty soon?

    100ms granularity => 10 updates per second. Now let's assume tickPrice() is being triggered three times per update (bidprice, askprice, lastprice... what less). That would be 3 x 10 = 30 messages per second. And we haven't even started...

    Things get even worse with updateMktDepth() and updateMktDepthL2(). In fast-moving markets, with a DOM of 20... how many insert/update/delete messages per second will that generate? At this point, it's my understanding that we will have surpassed the 50 messages per second limit.

    Let alone the fact that if you are concurrently watching/evaluating several symbols (as is my system's case) you will have to add the extra tickPrice() calls' messages too.

    Until now, I've been "feeding" my system via other data providers. But since I'm switching to IB, I'd like to use their feed too. Thing is, "grosso modo" I am calculating no less than 100 messages per second in order to feed my current ATS (taking into account all the subsystems: neural networks, decisional trees, money management module, order management module, etc.)

    This puts me in a situation, where I must choose whether I follow the API route, or I go directly for the CTCI path/FIX protocol thing. Truth to be told, I do not mind coding one or another, they both are pretty easy to implement. But what I wouldn't like is investing 10-12 days in coding an IB API connector, only for finding out the very first day that I am hitting the message limit.

    So, question is: could someone with first-hand experience about IB's system, give me a real estimation of how many messages per second will a reqMktData() and/or a reqMktDepth() generate?

    thanks for your time,
  2. i'd imagine those msg limits are for orders. if not, you'd prob want to run data from another acct. however, if you're using l2 for trade/routing decisions, you prob don't want to be using ib for data anyway.
  3. Bob111


    got to twsapi yahoo group..use gateway..the limit via ib gateway i believe its 200 msg.even after that imo ib feed is pretty much useless for things that mentioned above
  4. marauder


    thanks for your answers,

    that seems a nice bit of information for me; I mean, according to your posts, then I was wrong.

    I knew that IB is no place to go if you want your... how do you say it... "your hand to be held". Also, I knew that their charts leave a lot to be desired. Not a problem for me, since I use my own self-designed charting software.

    But, apart from that, it was my understanding that IB's feed was a good one. In fact, that is critical for my system. My algos depend heavily on the feed's quality, and things like fast/accurate 20-row level 2 DOM, for example, are of utmost importance to me.

    Now, I read your posts and I'm a bit confused: IB is a cheap platform, good for low-to-mid volume traders, etc. etc. , that's clear. But, isn't their feed a good one? Could you elaborate a bit on this, please?

    Also, if IB's feed is not up to the task, could you point me to a quality feed? I wouldn't mind routing my trades thru IB and getting my feed from another different company, if that was required in order to get a decent realtime level-2 DOM data.

    thanks a lot,
  5. JackR



    Definitely go to http://finance.groups.yahoo.com/group/TWSAPI. There are a number of group members who will help you. Join the group and search the archives before you ask any questions. The group members don't mind helping, but they don't like to answer questions that have been answered already (and will let you know it!).

    The IB datafeed sends you 100 symbols. Essentially, once requested, they keep coming and there is no "charge" against your message quota. Be sure that you understand IB's time-sliced (sampled) data feed. You do not get every trade, you get the most current trade\quote at the time of the sample. Sampling occurs between 3 and 5 times per second. There is a lot of discussion in the group (and here on ET) about the pros and cons of the IB method.

    Anyway, the Yahoo grioup is the place for detailed info and good help.

  6. marauder


    thanks for the hints!

    thing is, IB's nomenclature is a bit... prone to confusion, I'd say. From a pure technical standpoint, if I've got 50 messages per second, then I'd understand that I've got 50 messages, regardless of their content.

    But if they are talking about symbol/stock-grouped messages instead of individual messages... oh well, that's another different animal then.

    Anyway, I started asking for a pure technical question, but in the end I'm learning about a very different issue with IB (which is a great thing, and I must thank ET for it). It seems that their streaming method is not... let's put it this way... "issue-free".

    Of particular importance (to me and my ATS, at least) is that sentence: "you won't be seeing every trade". So it seems that their feed is not "true-tick". That could pose some problems for me, since I do need a faithful level-2 DOM stream.

    So I went out for a little "shopping", and right now I'm comparing offers from esignal and iqfeed, just for data feeding purpouses (I will still route my orders thru IB: gotta love their low comms )

    Considering my needs, iqfeed seems to hold the edge as of now (they are a pure feed service, nothing more, and nothing less), while esignal has a lot of bells and whistles which, honestly, I do not need.

    All in all, your info has been very valuable to me. Thanks a lot !