IB's Data feed

Discussion in 'App Development' started by Xraptor, Jul 7, 2016.

  1. Xraptor

    Xraptor

    Hello folk!

    I try building IB project and I have some problems with using IB's Data feed, I can't make rightly charting.

    1. Api IB returns HistoricalData with an end point at time but can't update last value.
    2. Has RealTimeBars but this function updating the bar only each 5 seconds.
    3. He has tickPrice but this tickPrice has not time value. And I don't understand if I set candle interval of one hour it is new candle or not.

    And how do to use this limitations that to get a working real-time chart?
    May be who know where is a working code as a sample?
     
  2. Gldr

    Gldr

    IB does not have real tick data. it sends 'consolidated' data every 3-5 seconds...
     
  3. J_Smith

    J_Smith

    What, you mean my NQ quotes in booktrader are delayed - surely you are not correct?

    J_S
     
  4. Xraptor

    Xraptor

    Yes Gldr it's your confusing!

    tickPrice it's the Tick Price, kind of 'consolidated' is RealTimeBars - 5 sec.

    But I still can't find a sample where is the scheme of charting, may be who do explain here how do this?
     
    Last edited: Jul 8, 2016
  5. That's not true. IB's tick data is consolidated ever 200-300 milliseconds.

    To OP:
    It sounds like you want to build new bars in real time. While it's true that ticks don't have timestamps you just have to use your server's time. Just make sure your time is frequently synchronized with one of the time servers.
    So first you'd download the historical bars, then you'd update the newly forming bar with the ticks you receive using your server's time. It's that simple.
    You'll find that your self-generated bars won't exactly match IB's historical bars. The way around this is to periodically replace the currently forming self-generated bar with IB's historical bar when the bar closes.
     
    Last edited: Jul 9, 2016
  6. Xraptor

    Xraptor

    stevegee58 I thought about this idea, but this the variant has big "But", if will be too much delays on internet ways between your client and server of IB charting will be incorrect!
     
  7. Xraptor

    Xraptor

    And else a moment if next candles wasn't deals how I will know it? Building empty candles or not?
     
  8. vicirek

    vicirek

    What is your programming environment that you are using for accessing IB data? Each has different ways of accessing graphics either built in or third party. In general you draw it yourself using bitmap or provide time series to charting utility that does it for you.
     
  9. Xraptor

    Xraptor

    I using C# + API IB + Microsoft Chart Control
     
  10. vicirek

    vicirek

    Chart control will do everything for you, just set the time series, type of chart, legends and it's done. For consistency plot no data bars with the last available data to keep X axis running. Do not worry about IB data. For most applications it is sufficient. There is some misunderstanding what server time means. TWS instance running on your computer is the server. Your application is the client. Server time in this case means your local computer time. You do not know what is the IB server time. The only time stamp from IB you can get is for bar data not ticks.
     
    #10     Jul 9, 2016