Keep your pc clock synchronized - futures io
futures io



Keep your pc clock synchronized


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one gomi with 13 posts (30 thanks)
    2. looks_two cunparis with 7 posts (7 thanks)
    3. looks_3 aslan with 5 posts (2 thanks)
    4. looks_4 Big Mike with 5 posts (1 thanks)
      Best Posters
    1. looks_one sam028 with 6.3 thanks per post
    2. looks_two NickA with 3 thanks per post
    3. looks_3 gomi with 2.3 thanks per post
    4. looks_4 cunparis with 1 thanks per post
    1. trending_up 23,056 views
    2. thumb_up 64 thanks given
    3. group 14 followers
    1. forum 48 posts
    2. attach_file 7 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Keep your pc clock synchronized

(login for full post details)
  #1 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received

After suffering for months of having my trade markers be 1-2 bars off, I finally found the cause (thanks to Ninjatrader support who analyzed my log files).

My PC clock runs slow. Very slow.

Windows vista will update the clock once a day, that's not enough for me.

So the solution is this free program which will update your clock every minute if you wish:

Thinking Man Software - Dimension 4 v5.0

So far it works great. Very fast and my clock is in sync. if your chart markers are off, check your pc clock.

Follow me on Twitter Started this thread Reply With Quote
The following 6 users say Thank You to cunparis for this post:

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(96 thanks from 15 posts)
looks_twoSalao's Journalby Salao
(32 thanks from 7 posts)
looks_3Deeteeĺs DAX Trading Journal (time based)by Deetee
(27 thanks from 11 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(13 thanks from 8 posts)
looks_5Maybe a little bit different journalby Malykubo
(9 thanks from 8 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Would You Sell Your System?
73 thanks
The Crude Dude Oil Trading System
42 thanks
Big Mike in Ecuador
39 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
24 thanks
futures io site changelog and issues/problem reporting
24 thanks
 
(login for full post details)
  #2 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 received

I had the same problem, with one of my workstation, and then synchronize it every 2 minutes. And it's very important to be perfectly synchronize, especially if you compare your charts with you trading mates in live, and you don't have the same patterns .

The NTP polling interval is just a key in the Windows registry (for XP, I think it's same thing on Vista and Seven), and you don't see an extra software to do this:
Tip

Start the Registry Editor
Go to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient \
Double-click the SpecialPollInterval value, and change the Base of the Value data to Decimal
change the Value data to the time interval you desire, noting that the time is given in seconds (120 for 2 minutes, 300 for 5 minutes, ...)



Some details here.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following 17 users say Thank You to sam028 for this post:
 
(login for full post details)
  #3 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


That explains why I had a hard time finding a little program to do it, it's obsolete.

or maybe not. Often when updating my time it times out. With the software I found, you can select a time server so i select INRIA which is close to where I live. Should be quicker and more reliable.

So I set windows to do it every 10 minutes as a backup.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
trader9278
louisiana
 
 
Posts: 14 since Jun 2009
Thanks: 0 given, 0 received


sam028 View Post
I had the same problem, with one of my workstation, and then synchronize it every 2 minutes. And it's very important to be perfectly synchronize, especially if you compare your charts with you trading mates in live, and you don't have the same patterns .

The NTP polling interval is just a key in the Windows registry (for XP, I think it's same sthink on Vista and Seven), and you don't see an extra software to do this:
Tip

Start the Registry Editor
Go to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ W32Time \ TimeProviders \ NtpClient \
Double-click the SpecialPollInterval value, and change the Base of the Value data to Decimal
change the Value data to the time interval you desire, noting that the time is given in seconds (120 for 2 minutes, 300 for 5 minutes, ...)



Some details here.

sam what is best to use 30 seconds , 1 minute ,5 minute ? would 1 second keep it perfectly in sync ?

Reply With Quote
 
(login for full post details)
  #5 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


trader9278 View Post
sam what is best to use 30 seconds , 1 minute ,5 minute ? would 1 second keep it perfectly in sync ?

Depends on how fast/slow it is. Mine loses 0.022 seconds per minute. That's 31 seconds per day and is enough to make the trade markers off by one bar if you're entering around the bar open or close.

I can't figure out why my pc clock would be off so much. It's not an old machine and it's always on so no battery issues. Not overclocked either.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
trader9278
louisiana
 
 
Posts: 14 since Jun 2009
Thanks: 0 given, 0 received


cunparis View Post
Depends on how fast/slow it is. Mine loses 0.022 seconds per minute. That's 31 seconds per day and is enough to make the trade markers off by one bar if you're entering around the bar open or close.

I can't figure out why my pc clock would be off so much. It's not an old machine and it's always on so no battery issues. Not overclocked either.

cunparis i dont think im off that much but i went to google and typed what time is it and i get the official US time clock. right now im off by 5 seconds but i just set it last week around this time,so it is not that bad but its not keeping up

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 received

Some timer chipset are better than others, no matter how new is your pc.
I found that machines with variable frequency processors (and using this function) seems to have more issues with this.
In a previous life, in a large financial institution, we were using GPS and radio devices for our NTP servers, like these, but for individual traders, an NTP update every 5-10 minutes, and having a 0.1 second difference with the real atomic time, it's ok, imho.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #8 (permalink)
 dsherman 
Michigan
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Optimus/Vision & Stage5/Vision
Trading: Futures
 
Posts: 40 since Jul 2009
Thanks: 22 given, 18 received

Thanks Cunparis. btw, you might want to spell check your original message. :-)

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


dsherman View Post
Thanks Cunparis. btw, you might want to spell check your original message. :-)

hahah good catch!!!

Follow me on Twitter Started this thread Reply With Quote
The following user says Thank You to cunparis for this post:
 
(login for full post details)
  #10 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,976 since Jun 2009
Thanks: 32,449 given, 98,207 received


I was recently writing code for a customer that needed to know the price market time, regardless of the PC clock time.

I found that there is actually a function to do this in Ninja, but it would seem that Zen Fire does not support it. Or I could be completely wrong, as I didn't investigate too deep.

But if you look at the BarTimer code as an example, it actually uses the data feed as the source for the time stamp.

So it seems that it is at least possible for your local PC clock to not matter, being off a few seconds, etc. I really don't know and haven't tried it, I keep my clock synced every few hours because I thought the same thing as you guys, that the bar formation was based on local time. And I still think it is, at least for Zen Fire.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #11 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


Big Mike View Post
So it seems that it is at least possible for your local PC clock to not matter, being off a few seconds, etc. I really don't know and haven't tried it, I keep my clock synced every few hours because I thought the same thing as you guys, that the bar formation was based on local time. And I still think it is, at least for Zen Fire.

I'm not sure when NT uses local pc time and when it uses exchange time, but I do know that NT uses the local pc time for the trade list and chart markers. I asked NT support why they don't use the exchange time for it and they just don't.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #12 (permalink)
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 748 given, 780 received


Big Mike View Post
I was recently writing code for a customer that needed to know the price market time, regardless of the PC clock time.

I found that there is actually a function to do this in Ninja, but it would seem that Zen Fire does not support it. Or I could be completely wrong, as I didn't investigate too deep.

But if you look at the BarTimer code as an example, it actually uses the data feed as the source for the time stamp.

So it seems that it is at least possible for your local PC clock to not matter, being off a few seconds, etc. I really don't know and haven't tried it, I keep my clock synced every few hours because I thought the same thing as you guys, that the bar formation was based on local time. And I still think it is, at least for Zen Fire.

Mike

Mike,

I'm interested!!!

Where can I find this BarTimer Code?

Thanks,

RJay

Reply With Quote
 
(login for full post details)
  #13 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,976 since Jun 2009
Thanks: 32,449 given, 98,207 received


RJay View Post
Mike,

I'm interested!!!

Where can I find this BarTimer Code?

Thanks,

RJay

Oops, I think I misread the code, now that I went and looked at it more closely to post here.

I was referring to Bars.MarketData.Connection.Options.Provider and Bars.MarketData.Connection.Now, I thought in my head that .Now was referring to DateTime.Now, but upon a second look of the code, I am not sure and I really have no time to test it.

BarTimer.cs, included with Ninja..

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #14 (permalink)
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 688 since Jun 2009
Thanks: 748 given, 780 received


Big Mike View Post
Oops, I think I misread the code, now that I went and looked at it more closely to post here.

I was referring to Bars.MarketData.Connection.Options.Provider and Bars.MarketData.Connection.Now, I thought in my head that .Now was referring to DateTime.Now, but upon a second look of the code, I am not sure and I really have no time to test it.

BarTimer.cs, included with Ninja..

Mike

Mike,

Could you post the code. My version refers to OpenTick. They went out of business.

Thanks,

RJay

Reply With Quote
 
(login for full post details)
  #15 (permalink)
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
 
cclsys's Avatar
 
Posts: 607 since Nov 2009
Thanks: 248 given, 392 received

Because I had lagging issues with dialup this synchronising is important to me to determine by how much. I have been using Symmetricom - Timing, Frequency and Synchronization Solutions - Assure Performance & Manage Next Generation Networks for some time, have it update automatically once an hour and have no complaints. Am using 2008 version not the latest.

If your data is lagging, then Bar-Timer and data in T&S will not line up because BarTimer knows that the bar is supposed to have ended but the T&S data coming in still hasn't got there yet.

In any case, I have the Symmetricom time window just beneath my T&S window and I can see when there is a lag. Most of the time there isn't (remember that in most setups there is a 500 ms lag in the T&S window unless you go into Ninja Options and make it less than that).

I now trade instruments that I know that 98% of the time there is no lag (volume issues via dialup).

You also might want to do regular ping tests on your machine to check latency. Some broadband providers - most of whom packet data including your lovely unpacketed Zenfire data - have much worse latency than others, up to 3-400 ms, i.e. almost half a second each way. So your PC time might be right, but your latency slow. Running the clock helps zero in on that as well.

On latency: I was surprised to find out that my rural neighbour's new wireless highspeed which I should get fairly soon has a latency of only 65 ms, which is very fast and I was accessing my own website based in the US for the test, not the relay station up the road.

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to cclsys for this post:
 
(login for full post details)
  #16 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,976 since Jun 2009
Thanks: 32,449 given, 98,207 received


RJay View Post
Mike,

Could you post the code. My version refers to OpenTick. They went out of business.

Thanks,

RJay

Sure, attached.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Attached Files
Register to download File Type: cs @BarTimer.cs (9.1 KB, 29 views)
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #17 (permalink)
sjrider
utah
 
 
Posts: 11 since Jul 2009
Thanks: 2 given, 10 received

Thanks for the info on the clock...I always figured there was a way to change how often it updates, but never knew how. Now I will not have to manually update every morning.

Reply With Quote
The following user says Thank You to sjrider for this post:
 
(login for full post details)
  #18 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

I did some research on this time sync issue.

Basically, the way "NTV V3" clients, like the Windows Time Service, work, is by regularly querying the time on a Time Server, updating the computer time, and waiting for next resync.

This is not a very good solution because
1. each time measure is not very precise
2. anyway the clock drifts between two measurements.

The solution is to install an NTP V4 Daemon. This system corrects both flaws : it uses multiple time sources to increase the precision of the time measurement, and it continually adjusts the local time clock using a PLL. It evaluates the hardware clock drift and keeps correcting it.

To install it , download it on Meinberg:
Meinberg NTP Software Downloads
and set it up.

Notes :
1.For vista it's simpler to use c:\tools than "c:\program files" because modifying files in program files is a pain.
2. Simplest way is to choose Local System account in setup screen
3. Don't forget to disable windows time service because both programs need the 123 udp port.

Then you can modify the config file and add some stratus 2 servers (connecting to stratus 1 is considered "not cool", stratus 1 servers are those connected to precise time sources)

You can find servers here StratumTwoTimeServers < Servers < NTP

Here's my conf file:
 
Code
driftfile "C:\Tools\NTP\etc\ntp.drift"

server ntp.crifo.org
server ntp.obspm.fr
server ntp.demongeot.biz
server ntp.duckcorp.org
server ntp.home-dn.net
server ntp2.hauke-lampe.de
server ntp1.theremailer.net
server ntp.accelance.net
server ntp.ciril.fr
server ntp2.emn.fr
server ntp.ensma.fr
server ntp.imag.fr
server ntp.internet-fr.net
server ntp1.jussieu.fr
server ntp.laas.fr
server ntp.sophia.cnrs.fr
server time.resolvlab.com
server ntp.uhb.fr
server ntp.unicaen.fr
server ntp.univ-lyon1.fr
server ntp.univ-metz.fr
server ntp.univ-reims.fr
server ntp.u-psud.fr

logfile "C:\Tools\NTP\log\ntp.log"

enable stats
statsdir "C:\Tools\NTP\etc\"
statistics loopstats
Then you start the service and there you go...

I attached pic of the status screen of the ntp server

Attached Thumbnails
Click image for larger version

Name:	ntp.png
Views:	190
Size:	31.0 KB
ID:	13495  
Reply With Quote
The following 8 users say Thank You to gomi for this post:
 
(login for full post details)
  #19 (permalink)
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 617 since Jan 2010
Thanks: 351 given, 1,111 received

I use Dimension 4 mentioned in the first post of this thread, and it works flawlessly for me. On Win 7, it needs to run as admin though. Best way to do, is to start it as a scheduled task that starts on login with highest privileges. Once you do that, your clock is continually synced all day.

I like the idea of a NTP V4 Daemon though, thanks for posting.

Reply With Quote
 
(login for full post details)
  #20 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received


aslan View Post
Once you do that, your clock is continually synced all day.

Well Dimension seems to be a basic NTPV3 client, so see above for drawbacks ;-)

Reply With Quote
The following user says Thank You to gomi for this post:
 
(login for full post details)
  #21 (permalink)
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 617 since Jan 2010
Thanks: 351 given, 1,111 received


gomi View Post
Well Dimension seems to be a basic NTPV3 client, so see above for drawbacks ;-)

Yes it is, but my clock is always very close. D4 shows you how much it moves the clock, and I never see more than very small fractions of a second, which is close enough for most things. Running your new GomTimeMeasure, it stays rock solid at <= 30ms delay. Good enough for me.

With that said, I am going to check out the NTP V4 though.

I assume you are looking at this to improve your GomRecorder?

Reply With Quote
 
(login for full post details)
  #22 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

Yes I was trying to see if the network latency is constant so I coould use System.Now as a time source to generate millisecond files. In my case it is not constant at all.

Please keep in mind that the indicator's meaningful value is when you see the values changing, so it gives you an indication of network lag increasing and decreasing, but the absolute number is meaningless unless you gave a good local clock precision (hence the NTPV4 stuff).

For instance, if your clock is 3 sec late, and the delay between the exchange and yourself is 3 sec, the indicator will show 0, even when in fact you're getting the ticks with 3 second lactency.

If your clock is 3 seconds ahead, and the network latency is 0 ms, the indicator will always show a delay of 3000 ms even when in fact you're getting your ticks in real time.

So I think there is a real use to get the clock of the PC at the best possible accuracy.

PS : there is a nice web site with screenshots of the install of NTPV4 client here:
https://www.satsignal.eu/ntp/setup.html

Reply With Quote
The following 3 users say Thank You to gomi for this post:
 
(login for full post details)
  #23 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,976 since Jun 2009
Thanks: 32,449 given, 98,207 received

gomi, you should call up or email Ray @ NT and ask him to hire you. I know your not solely in it for the money, based simply on how much you've given away to the community for free. And I know you don't have gobs of free time. But I think there is a possibility for a good compromise, and you could only benefit their team with your experience

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #24 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


gomi View Post
Well Dimension seems to be a basic NTPV3 client, so see above for drawbacks ;-)

I'm curious what the limitation is of NTPV3? I read a theoretical limitation but in real concrete numbers. My PC clock was off several seconds and that messed up my chart markers. Now with dimension 4 my chart markers are never off. So I think it's within a second which is "good enough" for me. But I'm curious how much better this other solution could be.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #25 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received


Big Mike View Post
gomi, you should call up or email Ray @ NT and ask him to hire you.

Thanks Mike, it could be an idea but I have had some bad relations with the support team.
I can remember a specific time where I nearly YouTube - Really bad day at the office? 'ed my keyboard trying to explain to the developers the problem with time zone conversion due to the DST not being the same day for everyone.
It's here : BeginTime EndTime timezone ? - Page 2 - NinjaTrader Support Forum

They just weren't listening, and Dierk posted a message stating
"You are incorrect in your understanding. It's very simple to calculate the Begin/EndTimeLocal from the Begin/EndTimeExchange, the actual date is totally irrelevant. Just DayOfWeek matters. You will see with NTB5."

He withdrew his message, and what we actually saw in NTB5 was the implementation I had been asking for during the whole thread.... No apology, no thank you, no nothing...

So they are not really on my employer wishlist... I've had my lot of non-listening people !


Big Mike View Post
I know your not solely in it for the money


Nah, I'm on bigmike for the ego soothing ;-) Thanks guys !

Reply With Quote
The following 4 users say Thank You to gomi for this post:
 
(login for full post details)
  #26 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received


cunparis View Post
I'm curious what the limitation is of NTPV3? I read a theoretical limitation but in real concrete numbers. My PC clock was off several seconds and that messed up my chart markers. Now with dimension 4 my chart markers are never off. So I think it's within a second which is "good enough" for me. But I'm curious how much better this other solution could be.

From what I've read NTPV4 is 10x more precise than NTPV3
NTPV3 on a WAN will give you accuracy ranging from a few 10s to a few 100s of millisecs
NTPV4 on a WAN will give you accuracy ranging from a few to a few 10s of millisecs.

With NTPV3 you clock drifts between updates, and the updates are made using "steps" . With NTPV4 you clock frequency is modified to compensate for drifts, clock modifications < 128 ms are smooth

Reply With Quote
The following 3 users say Thank You to gomi for this post:
 
(login for full post details)
  #27 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

Little upgrade on the topic. Here's how my clock is doing.

As you can see, for now the algo isn't making my offset converge.
Offset is the measure you're interested in, because it indicates the error between the local clock and the estimated global NTP time( time of servers with * or + on the NTP status)

What I know though is that my time is somewhere between +20/-20 ms of the estimated time. I want better !

Attached Thumbnails
Click image for larger version

Name:	loopstats.png
Views:	146
Size:	28.1 KB
ID:	13643   Click image for larger version

Name:	ntpstatus.png
Views:	134
Size:	22.8 KB
ID:	13644  
Reply With Quote
The following user says Thank You to gomi for this post:
 
(login for full post details)
  #28 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,673 since Jun 2009
Thanks: 3,789 given, 4,506 received


gomi View Post
...
I want better !

Only one solution for you, a GPS antenna and this.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #29 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

Less expensive and more fun :

Using ntpd, let's do some soldering on a Garmin OEM GP receiver (you need the OEM one because the standard one doesn't give you the PPS pulse)

An NTP Stratum-1 clock usng a GPS 18 LVC and Windows 2000/XP/Windows-7

Max offset : 200Ás


In Europe we can also use DCF77
Synchronising your network to a Conrad DCF77 receiver


In the meantime, I'm pretty sure 1-10 ms accuracy is attainable only using ntpv4 and time servers. Still fiddling with the settings....

Reply With Quote
The following user says Thank You to gomi for this post:
 
(login for full post details)
  #30 (permalink)
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 617 since Jan 2010
Thanks: 351 given, 1,111 received

I have been running with NTP for a couple of days now, and I have to say that my clock may or may not be more accurate than it was with D4.

Using D4, it was routinely within 5 ms (based on how much it was adjusted). For me, D4 usually was only moving the clock 1 or 2ms, and never had big adjustments.

Running NTP, the stats summary routinely shows the offset to be up to 50ms off, and it moves around during the day from being on to being off again. Using the GomTimeMeasure comfirmed this, as the delay would move all over the place during the day with NTP (although it was bounded to reasonable values), and with D4 it remained relatively stable. I have let it run for a long time to make sure it was stable, and have used very good local servers.

I know NTP can be better, but I guess I am just pointing out that it may not be.

Reply With Quote
 
(login for full post details)
  #31 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

Yep, for sure... +20/-20 is nothing to be excited about ... If you have 2 ms accuracy in measuring the latency between you and the time server, and the time server has 2 ms accuracy , a basic NTP V3 client will give you 4 ms accuracy...

Still investigating :-)

Reply With Quote
 
(login for full post details)
  #32 (permalink)
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 617 since Jan 2010
Thanks: 351 given, 1,111 received

This may be getting off topic, and perhaps it needs it own thread, but why do you need such an accurate timestamp?

I know you are trying to timestamp ticks better, but in reality what matters is the order of the bid/ask and ticks.

The problem with sec timestamps, is you might get 1000 ticks in a 1 sec interval (not to mention bid/ask updates), and how do you order those if they all have the same timestamp? Well everyone wants ms timestamps. Well that is all and good, but what if you now have 300 of those original ticks within 1 ms? You are still stuck. Again, you have to deal with the order of the events, and the only way to do that reliably is to use an event counter in addition to the timestamp. The problem here is that is yet another field that needs to be stored with your ticks and parsed when you read the ticks back, and developers don't want to pay the cost or deal with it. Dealing with relative order between instruments within a sec interval is another layer.

If you look at the IQFeed, they have solved this in two ways. First, when they send historical tick data, they send the bid/ask/last as a single unit, so you don't have to parse the bid/ask to figure out if the trade was a buy/sell. Secondly, when sending live data each tick has an ID. Now you pay a price for this processing, as the IQFeed is slightly slower (I suspect due to the additional processing).

So at the end of the day, more timestamp resolution may not be the solution (though I would like to see ms resolution).

Reply With Quote
The following user says Thank You to aslan for this post:
 
(login for full post details)
  #33 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 49,976 since Jun 2009
Thanks: 32,449 given, 98,207 received


gomi View Post
Little upgrade on the topic. Here's how my clock is doing.

As you can see, for now the algo isn't making my offset converge.
Offset is the measure you're interested in, because it indicates the error between the local clock and the estimated global NTP time( time of servers with * or + on the NTP status)

What I know though is that my time is somewhere between +20/-20 ms of the estimated time. I want better !

Gomi, I am thinking that you are not so much dealing with a variation of your PC time vs. Exchange time, but instead dealing with the 'bursts' of data that are lagging more then less then more again from your data provider. The Exchange time, and your PC time, are most likely relatively fixed over a short window of minutes to hours, but the data feed itself is not fixed.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #34 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

Well, this can be turned the other way round.. Who needs second resolution ? Aren't minute charts sufficent ;-) ?

Suppose I want to develop a time profile indicator, to spot areas where market tested the water a very short time and reversed. And by very short I mean less than a second. With a second resolution datafeed I can't do it.
I probably don't need millisec, maybe decisec or centisec could be enough, but either way 1 second is too slow.



aslan View Post
This may be getting off topic, and perhaps it needs it own thread, but why do you need such an accurate timestamp?

I know you are trying to timestamp ticks better, but in reality what matters is the order of the bid/ask and ticks.

The problem with sec timestamps, is you might get 1000 ticks in a 1 sec interval (not to mention bid/ask updates), and how do you order those if they all have the same timestamp? Well everyone wants ms timestamps. Well that is all and good, but what if you now have 300 of those original ticks within 1 ms? You are still stuck. Again, you have to deal with the order of the events, and the only way to do that reliably is to use an event counter in addition to the timestamp. The problem here is that is yet another field that needs to be stored with your ticks and parsed when you read the ticks back, and developers don't want to pay the cost or deal with it. Dealing with relative order between instruments within a sec interval is another layer.

If you look at the IQFeed, they have solved this in two ways. First, when they send historical tick data, they send the bid/ask/last as a single unit, so you don't have to parse the bid/ask to figure out if the trade was a buy/sell. Secondly, when sending live data each tick has an ID. Now you pay a price for this processing, as the IQFeed is slightly slower (I suspect due to the additional processing).

So at the end of the day, more timestamp resolution may not be the solution (though I would like to see ms resolution).


Reply With Quote
 
(login for full post details)
  #35 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received


Big Mike View Post
Gomi, I am thinking that you are not so much dealing with a variation of your PC time vs. Exchange time, but instead dealing with the 'bursts' of data that are lagging more then less then more again from your data provider. The Exchange time, and your PC time, are most likely relatively fixed over a short window of minutes to hours, but the data feed itself is not fixed.

Absolutely, but in this specific case I was trying to get the best stable PC clock... For now it's far far far worse than D4 :-)

Reply With Quote
 
(login for full post details)
  #36 (permalink)
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 617 since Jan 2010
Thanks: 351 given, 1,111 received


gomi View Post
Well, this can be turned the other way round.. Who needs second resolution ? Aren't minute charts sufficent ;-) ?

Suppose I want to develop a time profile indicator, to spot areas where market tested the water a very short time and reversed. And by very short I mean less than a second. With a second resolution datafeed I can't do it.
I probably don't need millisec, maybe decisec or centisec could be enough, but either way 1 second is too slow.

Yes, I was not saying you were wrong to be trying, only trying to figure out why such precision is needed, and depending what you are trying to do, it still may not be good enough.

I would like to see more precision from the exchange/vendors, but not holding my breath. Tradestation still does not have seconds!

Reply With Quote
The following user says Thank You to aslan for this post:
 
(login for full post details)
  #37 (permalink)
 NickA 
London
 
Experience: None
Platform: MC & Ninja mainly
 
Posts: 132 since Jan 2010
Thanks: 3 given, 49 received

Gomi, slightly off topic but the Zenfire API returns millisecond time stamped events. I guess NT just ignores this info as it stores stuff to 1 second resolution. I am not sure but I believe the data is time stamped by the Zen ticker plant.

The Zenfire API looks pretty straight forward and there is a sample app for download that compiles and gets ticks into a grid (full order book). I am not sure what your objective is but it might be worth considering recording straight from the API if you want millisecond accuracy (assuming that the data is time stamped at the exchange end). I hear that it is reasonably straight forward to pass the data on to NT though would not know myself. I guess you could save it straight into a Gomi recorder file.

Attached Thumbnails
Click image for larger version

Name:	zenapi.png
Views:	107
Size:	86.7 KB
ID:	13738  
Reply With Quote
The following 3 users say Thank You to NickA for this post:
 
(login for full post details)
  #38 (permalink)
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
 
cunparis's Avatar
 
Posts: 2,565 since Jun 2009
Thanks: 1,162 given, 2,081 received


NickA View Post
Gomi, slightly off topic but the Zenfire API returns millisecond time stamped events. I guess NT just ignores this info as it stores stuff to 1 second resolution. I am not sure but I believe the data is time stamped by the Zen ticker plant.

The Zenfire API looks pretty straight forward and there is a sample app for download that compiles and gets ticks into a grid (full order book). I am not sure what your objective is but it might be worth considering recording straight from the API if you want millisecond accuracy (assuming that the data is time stamped at the exchange end). I hear that it is reasonably straight forward to pass the data on to NT though would not know myself. I guess you could save it straight into a Gomi recorder file.

Can anyone use the API or do you have to pay a fee?

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #39 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
 
Posts: 1,091 since May 2010

About a year ago I took a demo of CQG. Their technical people are very impressive. I was on Vista at that time and it was crashing. They suggested it was likely because their servers use atomic precision in keeping time and that the issues were clock related.

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #40 (permalink)
 syxforex 
British Columbia
 
Experience: Advanced
Platform: NINJA
Broker: ZEN
Trading: Crude
 
Posts: 1,091 since May 2010

And now that I have read the thread it is clear I'm the only person in the sun-dial era....

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #41 (permalink)
 cw30000 
new york
 
Experience: Beginner
Platform: SC, NT
Trading: CL, GC
 
Posts: 213 since Sep 2009
Thanks: 99 given, 113 received

Is it me or IB, I always more than 1 second ahead. I tried both programs, same result. I used win7 64bits and dont know if this might be the problem

Sent from my PC36100 using Tapatalk

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #42 (permalink)
 Zwaen 
Netherlands, Blaricum
 
Experience: Intermediate
Platform: Excel, Python, R
Broker: IB
Trading: Options
 
Zwaen's Avatar
 
Posts: 250 since Dec 2010
Thanks: 848 given, 238 received

Thank you guys for this information. I was once very upset to use the button "reload historical data " ( control+shift+r) in NT.

Reply With Quote
 
(login for full post details)
  #43 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

I had a hard time using NTP, and tried to find out what the issues were.

It appears that NTP works needs symetrical delays on the network. If the up/down delays become assymetrical, this ends up with an error :

example of NTP queries against a stratum 1 server :
no network traffic :
Reference ID: TS-2
Root Delay: 0 ms
Root Dispersion: 1,7242431640625 ms
Round Trip Delay: 35,1391 ms
Local Clock Offset: 2,92545 ms


heavy download:
Reference ID: TS-2
Root Delay: 0 ms
Root Dispersion: 1,89208984375 ms
Round Trip Delay: 108,8157 ms
Local Clock Offset: -32,88685 ms


heavy upload :
Reference ID: TS-2
Root Delay: 0 ms
Root Dispersion: 2,1209716796875 ms
Round Trip Delay: 66,39 ms
Local Clock Offset: 18,5578 ms


So depending on your network traffic during the queries, your local offset estimation can vary a lot , and NTPV4's feedback loop will go crazy.



So the idea is "let's get rid of the network"

I used the tutorial here : NTP on Vista and Windows-7

You need a 35 USD GPS board that provides a 20 ns PPS precision (see measurements : MG1613S GPS Receiver)



Then all you need to do is solder a wire on the board as per the tutorial,



and voilÓ :


10 Ás jitter clock, for 35 USD, I'd say this is awesome. But I'm a geek, so I find lots of stuff awesome that other people don't ;-)

Reply With Quote
The following 7 users say Thank You to gomi for this post:
 
(login for full post details)
  #44 (permalink)
 Ducman 
The Netherlands
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NINJATRADER Brokerage / Continuum
Trading: CL
 
Ducman's Avatar
 
Posts: 469 since Nov 2010
Thanks: 408 given, 637 received


gomi View Post
I had a hard time using NTP, and tried to find out what the issues were.

10 Ás jitter clock, for 35 USD, I'd say this is awesome. But I'm a geek, so I find lots of stuff awesome that other people don't ;-)

LOL

Ducman

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #45 (permalink)
 Ducman 
The Netherlands
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NINJATRADER Brokerage / Continuum
Trading: CL
 
Ducman's Avatar
 
Posts: 469 since Nov 2010
Thanks: 408 given, 637 received


gomi View Post
I did some research on this time sync issue.

Basically, the way "NTV V3" clients, like the Windows Time Service, work, is by regularly querying the time on a Time Server, updating the computer time, and waiting for next resync.

This is not a very good solution because
1. each time measure is not very precise
2. anyway the clock drifts between two measurements.

The solution is to install an NTP V4 Daemon. This system corrects both flaws : it uses multiple time sources to increase the precision of the time measurement, and it continually adjusts the local time clock using a PLL. It evaluates the hardware clock drift and keeps correcting it.

@ gomi,

Installed the latest version, went smooth. My PC was also off a few seconds.

@cunparis

Thanks for bringing the subject up!

Ducman

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #46 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

If you installed NTP V4 daemon, you might want to check what you offset looks likeover time
You can use Meinber NTP monitor
NTP Time Server Monitor

here's mine for today : still about 10Ás accuracy

Reply With Quote
The following user says Thank You to gomi for this post:
 
(login for full post details)
  #47 (permalink)
 Ducman 
The Netherlands
 
Experience: Intermediate
Platform: NinjaTrader 8
Broker: NINJATRADER Brokerage / Continuum
Trading: CL
 
Ducman's Avatar
 
Posts: 469 since Nov 2010
Thanks: 408 given, 637 received


gomi View Post
If you installed NTP V4 daemon, you might want to check what you offset looks likeover time
You can use Meinber NTP monitor
NTP Time Server Monitor

here's mine for today : still about 10Ás accuracy
Attachment 59407

I get errors when activating the statistics, can't stop or start the NTP service from out the monitor. Tried various new installs but no luck so far.

Ducman

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #48 (permalink)
 gomi 
Paris
 
Experience: None
Platform: NinjaTrader
 
Posts: 1,248 since Oct 2009
Thanks: 274 given, 4,420 received

If you want to start/stop the service, you need to run the monitor as administrator.

Just in case, here is my conf file :

# ref-clock drivers
server 127.127.22.1 minpoll 4 # PPS - serialpps.sys
server 127.127.20.1 minpoll 4 mode 18 prefer # NMEA serial port, 16 = 9600 baud, 2 = $GPGGA

# Other servers
server 0.fr.pool.ntp.org minpoll 10
server 1.fr.pool.ntp.org minpoll 10
server 2.fr.pool.ntp.org minpoll 10
server 3.fr.pool.ntp.org minpoll 10
###########################################################
#Section insert by NTP Time Server Monitor 20/12/2011

enable stats
statsdir "C:\NTP\etc\"
statistics loopstats
###########################################################

driftfile c:\ntp\etc\drift

Reply With Quote
The following user says Thank You to gomi for this post:
 
(login for full post details)
  #49 (permalink)
 roztom 
Chicago, IL. USA
 
Experience: Advanced
Platform: IRT, Bookmap
Broker: EdgeClear, Rithmic
Trading: ES/NQ/Volume Profile
 
Posts: 38 since Oct 2011
Thanks: 24 given, 79 received

I use AtomTime Pro..it is a free download..works on XP & Win7 and can be done manually or on auto...

Free is Good..

Regards,

Tom

Regards,

Tom

Nothing To It But To Do It
Reply With Quote


futures io Trading Community Traders Hideout > Keep your pc clock synchronized


Last Updated on January 13, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts