IB data

Discussion in 'Data Sets and Feeds' started by ChrisMMM, Jul 20, 2007.

  1. is it possible to download data from IB and shoot it into a text file?
  2. Yes, using the API for historical data, and using Quotetracker for real-time current data.
  3. Here is the Java (1.5) code:

        public void tickString(int id, int tickType, String value) {
            printf("%-26s    %d  %s\n", TickType.getField(tickType), id, value);
        public void tickGeneric(int id, int tickType, double value) {
            printf("%-26s    %d  %f\n", TickType.getField(tickType), id, value);
        public void tickPrice(int id, int field, double price, int auto) {
            printf("%-26s    %d  %f  %d\n", TickType.getField(field), id, price, auto);
        public void tickSize(int id, int field, int size) {
            printf("%-26s    %d  %d\n", TickType.getField(field), id, size);
    These functions -- er, methods -- are called by the API. Forgive the use of 'printf', too.

    Note: this will 'printf' the realtime intraday data. Redirect it to a file, if it should be saved.

    'printf' should be 'System.out.printf'. My %-26s lets the logger prepend a timestamp. Whoops! the logger calls System.out.printf. I was simplifying in the code, but the idea is sound. Where 'printf' is shown, above, there is actually a call to 'myLog', with 'printf' like arguments -- you'll get the idea.
  4. thanks trader for the reply... funny thing is that I called IB tech and said it couldn't be done
  5. Couldnt be done?

    Are they that bad?

    Maybe they thought you were talking about data from within TWS itself.
  6. You can also do it with real-time data through the API, but if you do it through Quotetracker, it is easier and requires no programming.
  7. Bob111


    if you are programmer, you should check their website first, to see, what API is capable of. just go thru release notes and API documentation, methods and events speaks for themselves





    average IB CS know close to nothing about their API.ask them about is always bad idea, cause they may put you in totally wrong direction with their answers. better to try it, playing with demo or paper account.

    to OP-forget about data for bunch of tickers. Not going to work after first 10-50 requests.