NexusFi: Find Your Edge


Home Menu

 





How to measure data feed latencies between continents?


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one Koepisch with 22 posts (5 thanks)
    2. looks_two Big Mike with 18 posts (6 thanks)
    3. looks_3 artemiso with 11 posts (1 thanks)
    4. looks_4 gomi with 7 posts (21 thanks)
      Best Posters
    1. looks_one gomi with 3 thanks per post
    2. looks_two Fat Tails with 3 thanks per post
    3. looks_3 Big Mike with 0.3 thanks per post
    4. looks_4 Koepisch with 0.2 thanks per post
    1. trending_up 28,296 views
    2. thumb_up 48 thanks given
    3. group 8 followers
    1. forum 66 posts
    2. attach_file 15 attachments




 
Search this Thread

How to measure data feed latencies between continents?

  #11 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518


Big Mike View Post
Unless you are wanting microsecond precision, I think using NTP is sufficient instead of GPS.

You need a server in Chicago. Depending on your budget I would say either @sam028 which uses Steadfast backbone at 350 E. Cemak, or go with an Aurora server from your execution broker next to CME. The difference between these will be less than 1ms, but depending on your app that could be an eternity.

Sent from my LG Optimus G Pro

NTP was my first idea ("Internet clock adjustment"), but Fat Tails mentioned that there will be still an 100ms latency. But i think if i use the nearest NTP server the time is pretty precise. I don't know if the protocol implementation take the trip time to and from the NTP Server into account. If yes, everything is fine - i will check that too. And of course i will be utilizing SAM's systems for that test. For my strategy controlling a latency of 100-500 ms is sufficient, the real strategy execution will be aligned to latency vs. costs considerations. So for the running systems there will also be SAM in my boat.

But i'm really surprised that no one has some valid, proofable statistics about that topic. As an european trader i want to know if the data feed currently lagging 10, 100, 1000 or 30000 MS behind the exchange time. It's an relevant information, because if the feed lags, my system lags and i don't trade until the lag is gone. Many threads at BigMike are talking about high latency, but now longer term statistics can be found.

Koepisch

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
 
  #12 (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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655


Koepisch View Post
NTP was my first idea ("Internet clock adjustment"), but Fat Tails mentioned that there will be still an 100ms latency. But i think if i use the nearest NTP server the time is pretty precise. I don't know if the protocol implementation take the trip time to and from the NTP Server into account. If yes, everything is fine - i will check that too. And of course i will be utilizing SAM's systems for that test. For my strategy controlling a latency of 100-500 ms is sufficient, the real strategy execution will be aligned to latency vs. costs considerations. So for the running systems there will also be SAM in my boat.

But i'm really surprised that no one has some valid, proofable statistics about that topic. As an european trader i want to know if the data feed currently lagging 10, 100, 1000 or 30000 MS behind the exchange time. It's an relevant information, because if the feed lags, my system lags and i don't trade until the lag is gone. Many threads at BigMike are talking about high latency, but now longer term statistics can be found.

Koepisch

I strongly disagree on 100ms latency with NTP. Perhaps he was talking about Windows Time, which is not very efficient and loosely based on NTP.

NTP can easily obtain 1ms precision, usually in fact much less.

The reason most people don't have the info you are requesting is because most people on the forum are using retail platforms which don't provide that info. And if you are working with an API it is trivial to compute the latency, no real need for a discussion I don't think on "how" to do it.

As for a discussion on the benefits of lower latency, I think it's been discussed many times. It's all relevant to your application. If you aren't already co-located at Aurora then I don't believe you are anywhere near the "serious" level of most people that want to get into specifics about microsecond (or better) latency like @artemiso. Just guessing of course.

For the "professional" home trader concerned about latency, at the very least you would use a Chicago based server, like at the Equinix data center at 350 E Cermak. It is relatively cheap. As mentioned previously @sam028 offers a few options of VPS or dedicated at that location for reasonable price, or you could go direct to Steadfast if you have the manpower to manage everything.

I have several servers at Equinix. I do not care about gaining that last mile 1ms advantage and therefore do not spend the extra money to be at Aurora. As I spend more and more time developing my custom platform, that may change and it's a simple cost/benefit analysis. There are some latency and real world $$ benefits of being inside that 1ms barrier even for non-HFT, but how much of a benefit will again depend on your strategy.

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
Thanked by:
  #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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655



Koepisch View Post
NTP was my first idea ("Internet clock adjustment"), but Fat Tails mentioned that there will be still an 100ms latency.

If you are referring to post #5 in this thread, the 100ms he is talking about is the speed of light delay between your location and Chicago. Nothing to do with NTP.

NTP will use server pools nearby your physical location (determined based on ping response) automatically, and it also automatically prioritizes based on the quality of those clock sources (ie GPS or etc) from those servers.

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)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


Koepisch View Post
NTP was my first idea ("Internet clock adjustment"), but Fat Tails mentioned that there will be still an 100ms latency. But i think if i use the nearest NTP server the time is pretty precise. I don't know if the protocol implementation take the trip time to and from the NTP Server into account. If yes, everything is fine - i will check that too. And of course i will be utilizing SAM's systems for that test. For my strategy controlling a latency of 100-500 ms is sufficient, the real strategy execution will be aligned to latency vs. costs considerations. So for the running systems there will also be SAM in my boat.

But i'm really surprised that no one has some valid, proofable statistics about that topic. As an european trader i want to know if the data feed currently lagging 10, 100, 1000 or 30000 MS behind the exchange time. It's an relevant information, because if the feed lags, my system lags and i don't trade until the lag is gone. Many threads at BigMike are talking about high latency, but now longer term statistics can be found.

Koepisch

I think you misunderstood @Fat Tails comment, an NTP synchronized clock will be accurate with a few ms precision, far below 100ms. And whatever the NTP servers are, that the magic of NTP .
Depending on the PC hardware clock, the drift can be high, some chips are more reliable than other. There are alos few tricks to know: CPU with power-efficiency frequency adjustment will be less precise than CPU running always at 100% of their nominal frequency.
Virtual Machines are also less precise, as the physical CPUs are shared between multiple VMs. On my VPS the NTP sync is done every minute, which is not useful on a physical server which an accurate clock.

I think a simple way would be to have a NinjaTrader strategy, comparing using OnMarketData(), and compare times.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #15 (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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655

High Frequency Trading and the True Value of Time - Victor Yodaiken's blog - The Trading Mesh

That article also mentions PTP (Precision Time Protocol) as an alternative to NTP.

Anyway I fear I may have got off topic with your thread. The easiest answer to your question remains to simply use a data feed supplied exchange time marker and compare it to local time.

You should remove NT7 from the equation as it doesn't support better than 1 second resolution anyway.

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
  #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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655


Big Mike View Post
The easiest answer

Let me try again

The easiest answer is to just use ping. Ping your broker/data feed. That will probably get you 98% there in terms of latency and takes about 1 second of your time to implement it.

This would work best in the case of a broker supplied data feed and not IQFeed which is in a very different physical location to CME, whereas most brokers are co-located next to CME. IQFeed is not a latency sensitive feed but instead is focused on accuracy, whereas broker feeds are focused on latency and thus give up accuracy (such as dropping L2 events not important to execution) to get there.

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
Thanked by:
  #17 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103


Koepisch View Post
@Fat Tails
Perhaps it is possible to use this method to get the Delta from exchange to europe:

1. Use R|API or CQG to get the EXCHANGE timestamp of the tick tuple.
2. Install a GPS-based time module at your PC
3. Match the incoming tick with the current time of your GPS time

@Koepisch: It is not possible to synchronize your PC to the level of milliseconds, because the data exchange and transmission itself takes several milliseconds. There are a few problems you need to be aware of if you wish to compare the time stamps of the data feed with your PC time.

Reference time being used - UTC, GPS or TAI

There are three available reference times, UTC, GPS and TAI (Temps Atomique International). TAI is about 19 seconds (=19000 milliseconds) ahead of GPS and GPS is about 16 sec (16000 milliseconds) ahead of UTC. This suggests that you better use the same reference time, which is used by exchange and data provider, if you want to find out about a lag which is less than 16000 milliseconds.

I think that the CME trade engine is synchronized to NTP, an interesting discussion of time-stamps can be found here:

https://www.nanex.net/aqck2/4436/RevisitingFedRobbery.pdf


Synchronisation of Trading PC with NTP

The correct synchronization time is NTP. To avoid any issues with lag of the time signal, you should use

- the nearest available NTP time server (which is PTB)
- not connect to that time server via internet (approx. lag 25 msec) but via radio clock receiver (approx. lag 3 msec)

There are some products available from Meinberg that can be connected via USB and that will allow accurate synchronization of your PC. I do not know the accuracy level though.

USB Radio Clocks


Measuring the lag of the Data Feed

You can now compare the time stamps of the data feed to the synchronized time of your PC. The result will still suffer from a few errors

-> due to the lag of the radio signal from the PTB atomic clock
-> due to data processing
-> due to inaccurate synchronization of your PC
-> due inaccurate synchronization of the internal clock of the CME maching engine

However, these errors should only add up to something like 10 - 20 msec, which is good enough for monitoring the data feed lag, which is about 50 msec (100 msec referred to the round trip) or larger. You should even be able to show the current lag on your NinjaTrader tick-built chart as an indicator.

Reply With Quote
  #18 (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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655


Fat Tails View Post
@Koepisch: It is not possible to synchronize your PC to the level of milliseconds, because the data exchange and transmission itself takes several milliseconds. There are a few problems you need to be aware of if you wish to compare the time stamps of the data feed with your PC time.

Reference time being used - UTC, GPS or TAI

There are three available reference times, UTC, GPS and TAI (Temps Atomique International). TAI is about 19 seconds (=19000 milliseconds) ahead of GPS and GPS is about 16 sec (16000 milliseconds) ahead of UTC. This suggests that you better use the same reference time, which is used by exchange and data provider, if you want to find out about a lag which is less than 16000 milliseconds.

I think that the CME trade engine is synchronized to NTP, an interesting discussion of time-stamps can be found here:

https://www.nanex.net/aqck2/4436/RevisitingFedRobbery.pdf


Synchronisation of Trading PC with NTP

The correct synchronization time is NTP. To avoid any issues with lag of the time signal, you should use

- the nearest available NTP time server (which is PTB)
- not connect to that time server via internet (approx. lag 25 msec) but via radio clock receiver (approx. lag 3 msec)

There are some products available from Meinberg that can be connected via USB and that will allow accurate synchronization of your PC. I do not know the accuracy level though.

USB Radio Clocks


Measuring the lag of the Data Feed

You can now compare the time stamps of the data feed to the synchronized time of your PC. The result will still suffer from a few errors

-> due to the lag of the radio signal from the PTB atomic clock
-> due to data processing
-> due to inaccurate synchronization of your PC
-> due inaccurate synchronization of the internal clock of the CME maching engine

However, these errors should only add up to something like 10 - 20 msec, which is good enough for monitoring the data feed lag, which is about 50 msec (100 msec referred to the round trip) or larger. You should even be able to show the current lag on your NinjaTrader tick-built chart as an indicator.

I am not one to usually disagree with @Fat Tails... but...

1) Yes you can measure latency with millisecond and even microsecond accuracy. It is trivial when using any API that sends the Exchange timestamp. The difference between your PC time and the Exchange time is your latency, or how old that update is when you receive it. The transmission time does not distort the results, it will simply be part of the results.

2) If you are in a data center, you will find NTP <1ms away. If you aren't in a data center, why bother with latency at all?

3) You don't need a hardware device when in a data center. Steadfast already has an NTP server and there are many others in Chicago that do as well. NTP will sync with any of them and the precision can be measured as less than 1ms.

Pretty much all of this is irrelevant, I think the simplest answer to the original question is just to use ping.

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
  #19 (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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655

Steadfast is a stratum 1 source (GPS):

https://support.steadfast.net/Knowledgebase/Article/View/103/0/ntp-time-servers

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
  #20 (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,460 since Jun 2009
Thanks Given: 33,234
Thanks Received: 101,655


Output from ntpq peers, using Steadfast NTP, from one of my Equinix datacenter servers:

 
Code
ntpq> pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*lookingglass.ch 216.86.146.46    2 u    3   64  377    0.189    0.062   0.047
+ip46.216-86-146 .GPS.            1 u    5   64  377    0.310    0.011   0.021
+ntp.your.org    .CDMA.           1 u    6   64  377    1.379   -0.009   0.082
Shows 189 microseconds and 310 microseconds respectively (<1ms), this is round trip time. Also shows accuracy/precision of 6 microseconds and 1 microsecond.

The third entry is another stratum 1 server in Chicago that is public.

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




Last Updated on February 17, 2014


© 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