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.
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.
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.
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.
I am in china,when i click the button 'current time' of a demo,it returns currenttime=1343965311 why?
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.