开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Latency of reqTickByTickData


 

开云体育

Michael

?

I’m interested in your rather dismissive assertion about timekeeping in Windows. Your experience seems to differ considerably from mine.

?

The first thing to say is that Windows, out of the box, comes with a fairly lax configuration for its NTP. This is because it hasn’t historically been a requirement for Windows to give high precision timestamping, just enough for the purposes of maintaining reasonable synchronization between the computers in an Active Directory domain. Microsoft have traditionally left it to third parties to provide precise mechanisms. I suspect at least a part of Microsoft’s motivation here is the sheer number of Windows machines: if every Windows computer were syncing to a time server every 20 seconds, the world’s time servers would collapse in a heap, and the vast majority of Windows computers don’t need to be synchronised to anything less than a second or so. With modern hardware, clock drift is relatively slow, so there’s no big issue here.

?

So for example a workstation edition of Windows (eg Windows 10 Home or Windows 10 Professional) which is not configured as part of a domain,? synchronises infrequently with the default time server (which is time.windows.com). And a workstation that IS part of a domain uses the domain controller as a time server, and again synchronises infrequently. In both cases, in my experience, the offset between the client machine and the time server tends to be less than around 100 millisecs.

?

By the way, for those who don’t know, there is a handy command which enables you to see directly the offset between your machine’s clock and a specified time server (note however that this command will only run if the Windows Time service is running, and for Windows 10 Home edition this is not the case by default) . From an administrative command prompt type a command like this:

?

w32tm /stripchart /computer:pool.ntp.org /period 5

?

The /computer argument specifies which computer to compared your local clock against: pool.ntp.org is a large and growing set of worldwide time servers.

?

(If you know of an equivalent command on Ubuntu 16.04 or later that gives similar information, please let me know.)

?

For Windows Server, I’m not sure what the out-of-the box settings are, because I have changed mine, but it’s certainly possible to configure it so that the synchronisation is quite good. My Windows Server 2012 box typically has offsets hovering around 2 milliseconds, which I’m not unhappy with. I don’t see any evidence of amazing ugly jumps: maybe you’re talking about older versions? But hey, 2012 isn’t exactly recent!

?

My understanding is that there were improvements in Windows Server 2016 to get millisecond accuracy.

?

And the big news is that Windows Server 2019 will implement the new Precision Time Protocol, which will enable vastly more accurate time syncing. I suggest you read this:

?

By the way, the Windows Time service in the workstation Windows editions is the same as in the server editions, so it may well be the case that a Windows 10 PC could be configured to be just as accurate as my Server 2012: I just haven’t tried to do it (because I don’t need to). Perhaps I should check it out…

?

Richard

?

?

?

From: [email protected] <[email protected]> On Behalf Of michaelIC via Groups.Io
Sent: 06 September 2018 06:51
To: [email protected]
Subject: Re: [TWS API] Latency of reqTickByTickData

?

Dmitry,

PPS on Pi has significant lag, variable lag, isn't a RT OS, is multi-core, jittery CPU, and then you're taking it as a reference delivered through variable Ethernet speeds as its under a USB controller. You may find it interesting to turn off NTP on your boxes, turn off any running load on your boxes, then bring the Pi reference time across and compare it to system time.

Then compare again with your trading load running.

And if you're comparing to Windows system time, you're going to be amazed at the variability and ugly jumps that makes. Windows system time lags variably and horribly depending on load.

Join [email protected] to automatically receive all group messages.