Forums (http://www.elitetrader.com/vb/index.php)
- Hardware (http://www.elitetrader.com/vb/forumdisplay.php?forumid=4)
-- Syncing Laptop Time to Atomic Time (http://www.elitetrader.com/vb/showthread.php?threadid=236206)


Posted by CPTrader on 02-08-12 12:03 AM:

Syncing Laptop Time to Atomic Time

Hello,

How can I set up my laptop to automatically sync itself periodiclaly intra-day to the atomic clock.

My computer seems to always be 1-2 minutes slow or fast which affects scheduiled takss.

Thanks!


Posted by dom993 on 02-08-12 12:12 AM:

I use Dimension4 from Thinking Man Software. It is free and does just what you want.


Posted by Kevin Schmit on 02-08-12 12:36 AM:

Re: Syncing Laptop Time to Atomic Time


Quote from CPTrader:

Hello,

How can I set up my laptop to automatically sync itself periodiclaly intra-day to the atomic clock.

My computer seems to always be 1-2 minutes slow or fast which affects scheduiled takss.

Thanks!


Assuming you are running Windows 7, first check that the "Windows Time" service is running. If it isn't, start it.

To increase the sync frequency, start regedt32.exe

Go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

and change the "UpdateInterval" key to a smaller value. Try 20,000 instead of the default of 360,000


Posted by CPTrader on 02-08-12 12:40 AM:

Re: Re: Syncing Laptop Time to Atomic Time


Quote from Kevin Schmit:

Assuming you are running Windows 7, first check that the "Windows Time" service is running. If it isn't, start it.

To increase the sync frequency, start regedt32.exe

Go to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config

and change the "UpdateInterval" key to a smaller value. Try 20,000 instead of the default of 360,000



How do I check to see that Windows Time service is running? Thanks!


Posted by CPTrader on 02-08-12 01:00 AM:

I was able to change the time interval, but there seems to be no change. My time is still wrong.

I also noticed that if I manualy click on my Windows clokc and try an dmnaually upate the time by synching to time.nist.gov I get a error message: "An error occurred while Windows was synchronizing with time.nist.gov"


Posted by Kevin Schmit on 02-08-12 01:53 AM:

Re: Re: Re: Syncing Laptop Time to Atomic Time


Quote from CPTrader:

How do I check to see that Windows Time service is running? Thanks!


In the Task Manager, in the "Services" tab. You can start the task manager by typing cmtrl-alt-delete


Posted by Kevin Schmit on 02-08-12 01:55 AM:


Quote from CPTrader:

I also noticed that if I manualy click on my Windows clokc and try an dmnaually upate the time by synching to time.nist.gov I get a error message: "An error occurred while Windows was synchronizing with time.nist.gov"


Try choosing another time server in the drop-down menu in the "internet time" tab. Try time.windows.com


Posted by CPTrader on 02-08-12 02:02 AM:


Quote from Kevin Schmit:

Try choosing another time server in the drop-down menu in the "internet time" tab. Try time.windows.com



Thanks, Kevin.

I tried several time servers. None works.


Posted by igorip204 on 02-08-12 02:45 AM:

The NIST servers listen for a NTP request on port 123, try opening port or better solution http://www.symmetricom.com/resource...loads/symmtime/


Posted by CPTrader on 02-08-12 02:47 AM:


Quote from igorip204:

http://www.symmetricom.com/resource...loads/symmtime/



Thanks igorip, but it does not work with Windows 7


Posted by jprad on 02-08-12 03:41 AM:

Re: Syncing Laptop Time to Atomic Time


Quote from CPTrader:

Hello,

How can I set up my laptop to automatically sync itself periodiclaly intra-day to the atomic clock.

My computer seems to always be 1-2 minutes slow or fast which affects scheduiled takss.

Thanks!



Instructions from those who maintain the US time reference:

http://www.nist.gov/pml/div688/grp40/its.cfm

If you're a real time geek then this is interesting reading...

http://www.nist.gov/pml/div688/utcnist.cfm

__________________
-jack-


Posted by brownsfan019 on 02-08-12 04:52 AM:


Quote from dom993:

I use Dimension4 from Thinking Man Software. It is free and does just what you want.



This is perfect, I love it. All trading computers have this installed and does the job.


Posted by CPTrader on 02-08-12 04:07 PM:

Re: Re: Syncing Laptop Time to Atomic Time


Quote from jprad:

Instructions from those who maintain the US time reference:

http://www.nist.gov/pml/div688/grp40/its.cfm

If you're a real time geek then this is interesting reading...

http://www.nist.gov/pml/div688/utcnist.cfm




Thank you! I downloaded the program at: http://www.nist.gov/pml/div688/grp40/its.cfm

and it seems to work. It updates my clock every hour.

Many Thanks!


Posted by Brass on 02-08-12 04:29 PM:

http://download.cnet.com/Chronos-At...tml?tag=mncol;4

It can update your computer clock from every 30 seconds to every 3 days. I update mine every 5 minutes.


Posted by PocketChange on 02-08-12 04:30 PM:

Take a look at meinberg NTP:

http://www.meinberg.de/english/sw/t...ver-monitor.htm


Posted by imabadboy on 02-09-12 01:46 AM:

windows task scheduler


Posted by WinstonTJ on 02-09-12 05:12 AM:

I'll find this and then re-bump this thread because the Mods won't allow us to edit after 30min.


http://support.microsoft.com/kb/307897

^^^ That's how to update your clock via command line. I have a script that runs once daily to update and sync.

You essentially write a .txt (notepad) document that says "go out and re-sync time via command line" and then change the .txt to .bat. Once it's a .bat file you can schedule it in the Windows Task Manager.

It runs just like you can schedule antivirus or disk defrag.

http://www.ntp.org/

It's a good idea to pick a few if you can. If not at least find out who your data & broker sync to and use those.


I'll dig up my .bat file and post it in this thread on Saturday - next time it is convenient to log into a machine that has it running.


Posted by mgookin on 02-09-12 02:14 PM:

You should not re-sync your clock while trading programs are running.


Posted by CPTrader on 02-09-12 02:30 PM:


Quote from mgookin:

You should not re-sync your clock while trading programs are running.



Why is that?!


Posted by WinstonTJ on 02-09-12 03:56 PM:


Quote from mgookin:

You should not re-sync your clock while trading programs are running.



Nice catch/comment - that's a very good point.

For most people a normal weekly sync to time.windows.com is more than enough - your latency (and changes in latency between trades/quotes) will be more of an issue than worrying about your CPU clock cycle being slightly off.

If your time is slightly off and you correct it while your system is running it can cause a break - quotes have time stamps, orders & messages have time stamps - your broker may do anything from place things out of order to just ignore or dismiss your trades.

When you initially log in the platform syncs with the broker. If you change that mid-session it depends on the code and the platform but it could range from zero/minimal impact to a freeze and reboot/restart required.

For what it's worth - You probably don't need to worry. If you have issues with losing time completely you may need to replace your CMOS battery. If you are that fast/slow that you are seconds off daily and you have a fresh CMOS battery I'd look elsewhere to the motherboard, power drains, CPU failure (extremely rare), etc.


Posted by ScoobyStoo on 02-09-12 07:12 PM:


Quote from WinstonTJ:

If your time is slightly off and you correct it while your system is running it can cause a break - quotes have time stamps, orders & messages have time stamps - your broker may do anything from place things out of order to just ignore or dismiss your trades.

When you initially log in the platform syncs with the broker. If you change that mid-session it depends on the code and the platform but it could range from zero/minimal impact to a freeze and reboot/restart required.



Your platform would have to be an incredibly poorly architected piece of software for it to rely on the clock on your local machine for anything critical. Any market data messages should use the timestamp provided by the data provider. All order related messages should be timestamped by the broker/FCM infrastructure upon transmission/reception.

It is precisely because the clock on a machine can be altered whilst an application is running that it should never be relied upon by 3rd party apps for critical operations.

Try connecting to your broker's demo/test environment (if available) and then changing the clock. If your platform doesn't handle it gracefully (eg. crashes, hangs or generally starts to misbehave) then you have to start asking questions about the quality of the product.


Posted by ScoobyStoo on 02-09-12 07:21 PM:

P.S. Obviously every trader does need an accurate local clock so they can be aware of impending significant market events (eg. open, close, news release) when making execution decisions. For this purpose Dimension4 is excellent. Start it up on a low priority thread (so it doesn't hog CPU cycles in a fast market just when you need them) and you can keep your clock millisecond accurate with very little hassle.


Posted by kittermh on 02-09-12 07:31 PM:

Thanks

Thanks for this intel, all, I had the very same question!


Posted by CPTrader on 02-10-12 01:38 AM:

Many Thanks to all who contributed. Very much appreciated.


Posted by Craig66 on 02-10-12 01:50 AM:

This works pretty good, running it on win7 64bit.
http://www.meinberg.de/english/sw/ntp.htm


Posted by WinstonTJ on 02-10-12 05:32 AM:


Quote from ScoobyStoo:

Your platform would have to be an incredibly poorly architected piece of software for it to rely on the clock on your local machine for anything critical. Any market data messages should use the timestamp provided by the data provider. All order related messages should be timestamped by the broker/FCM infrastructure upon transmission/reception.

It is precisely because the clock on a machine can be altered whilst an application is running that it should never be relied upon by 3rd party apps for critical operations.

Try connecting to your broker's demo/test environment (if available) and then changing the clock. If your platform doesn't handle it gracefully (eg. crashes, hangs or generally starts to misbehave) then you have to start asking questions about the quality of the product.



Agree 100%.

I exchanged IM's with a guy today asking him about safe latency - usually the ultra low latency guys run "raw" (like raw as in without a condom... or without a firewall since that slows you down 10-500 milliseconds) but how do we "screw with a condom and be just as good"?

(sorry for the vulgar example but most will understand)

So if your running raw a change on the local machine can be huge - catastrophic. If you aren't and you have buffers, TCP data, local machine supported broker platform, etc. then you could set your local time to 1929 30 second prior to the crash and orders would keep executing.

These are two extremes however what a time sync really suggests is the difference between a CPU clock cycle (3.0ghz = how many "cycles per second") and real time. A computer ALWAYS estimates a curve - so there is a legit break. A computer can't ever exactly reproduce a curve - think of pixels vs. a true drawn curved line. Up close the pixels look like a staircase while a line drawn by hand will always be smooth and continuous. Computers are getting closer (the steps on the staircase are getting shorter & smaller) but they are still 90* angles (or small segmented straight lines trying to build a curve). There will always be a break and depending on environmental factors such as temp, humidity, die consistency, no two CPUs are the same therefore every machine needs to be told what time it really is (irony is that an inaccurate machine is telling another inaccurate machine what time it is).

That said 99.99999% of the world is sitting in some random office and has zero need for an intra-day update in their time servers. Google "how fast can the human eye see" and you'll learn it's between 15 and 20 milliseconds. That's how long the relay takes between the light hitting your retina and your brain understanding it. If you are worried about your machine's internal clock being off by sub-milliseconds I really think you are chasing something that's fairly insignificant.

Everything I have syncs weekly to whatever server is most relevant - but never daily or hourly. The sync runs just after a full virus scan (if there is AV on that machine) and Windows Update.

Probably a wasted effort but makes us feel good. I'll retrieve the batch files & instructions on Saturday and post up soon.


All times are GMT. The time now is 05:15 PM.

Copyright © 2012 Elite Trader.