How to get timestamp using IB as a data feed

Discussion in 'Data Sets and Feeds' started by abarzov, Aug 31, 2011.

  1. abarzov

    abarzov

    For some reason I use IB as a data feed. It's not a very good idea, but I must. I implemented IB's socket client ( particularly void tickPrice2(..) ) and I get a standard set of data ( price, bid, ask etc.).
    The only thing I cannot obtain is timestamp.
    Does anyone know how to get it?
     
  2. I'm using c# and not the socket interface but in theory my method should work for you.

    Call the reqConnectionTime() method and then when the event is received, determine the difference between the time returned (which is time on the server side) and your local time.
    Then, every time a tick event is received, you can just reference your local time and compensate with the known offset.
    It's not a perfect timestamp, but should be accurate for most applications.
     
  3. abarzov

    abarzov

    This is a great idea. As a matter of fact I just need the difference.
    Thank you very much.