Discussion in 'Automated Trading' started by walterjennings, Apr 13, 2007.

  1. Hey. I was wondering if anyone know if there was a way to get the time from TWS through the API? Iv noticed the windows clock drifts slightly from the clock in the bottom right of the TWS window. Id like to use the TWS clock to make my automated app react differently around news events.
  2. when the API first connects to tws, tws sends its notion of the current time

    assuming that tws stays sync'd with an accurate time source, if you sync the PC with an accurate time source you'll be OK. try ntp? i don't know that there is any API method to query the tws time.
  3. ahh thanks! i thought i tried that but apparently when i changed the windows clock to test, you have to restart tws for the tws-time to recorrect.
  4. sprstpd


    Run a 3rd party app to synch your clock and then just use your clock as the ultimate authority.
  5. Yeah, I would try syncing the PC to an accurate clock before starting tws.
  6. Has anyone noticed that after synching the computer's time that the API shows a time that is about 1 second late ?
    This has bothered me....and indicates the IB Servers are either delayed or their time is not synched.
    No response to my post on the IB API forum either.
  7. I am in china,when i click the button 'current time' of a demo,it returns currenttime=1343965311 why?
  8. The demo account is all probably bogus and fake data. Don't pay attention to that.
  9. Just call your sales rep or any of the guys at IB and ask them what time server they sync to.

    Google NTP servers, a ton will come up. Your windows box is probably sync'd to time.windows.com but you can easily have that changed.

  10. what should I do to change it?
    #10     Aug 3, 2012