NexusFi: Find Your Edge


Home Menu

 





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 28,220 views
    2. thumb_up 64 thanks given
    3. group 14 followers
    1. forum 48 posts
    2. attach_file 7 attachments




 
Search this Thread

Keep your pc clock synchronized

  #11 (permalink)
 
cunparis's Avatar
 cunparis 
Paris, France
 
Experience: Advanced
Platform: Market Delta & Ninjatrader
Trading: ES
Posts: 2,565 since Jun 2009
Thanks Given: 1,162
Thanks Received: 2,093


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

Can you help answer these questions
from other members on NexusFi?
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
Futures True Range Report
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
GFIs1 1 DAX trade per day journal
22 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
The Program
20 thanks
  #12 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 682 since Jun 2009
Thanks Given: 757
Thanks Received: 787


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
  #13 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,539



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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #14 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 682 since Jun 2009
Thanks Given: 757
Thanks Received: 787


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
  #15 (permalink)
 
cclsys's Avatar
 cclsys 
Sydney, NS
 
Experience: Intermediate
Platform: Ninja
Broker: Zen-Fire
Trading: TF,S,GC
Posts: 605 since Nov 2009
Thanks Given: 248
Thanks Received: 393

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 NexusFi Trade Journal Reply With Quote
Thanked by:
  #16 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,539


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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Attached Files
Elite Membership required to download: @BarTimer.cs
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #17 (permalink)
sjrider
utah
 
Posts: 11 since Jul 2009
Thanks Given: 2
Thanks Received: 10

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
Thanked by:
  #18 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505

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:	362
Size:	31.0 KB
ID:	13495  
Reply With Quote
  #19 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 625 since Jan 2010
Thanks Given: 356
Thanks Received: 1,127

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
  #20 (permalink)
 gomi 
Paris
Market Wizard
 
Experience: None
Platform: NinjaTrader
Posts: 1,270 since Oct 2009
Thanks Given: 282
Thanks Received: 4,505



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
Thanked by:




Last Updated on January 13, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts