How to measure data feed latencies between continents? - Traders Hideout | futures io social day trading
futures io futures trading


How to measure data feed latencies between continents?
Updated: Views / Replies:6,101 / 66
Created: by Koepisch Attachments:18

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 18  
 
Thread Tools Search this Thread
 

How to measure data feed latencies between continents?

  #51 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received


artemiso View Post
I'm not a very good programmer, so I apologize if the code is incomprehensible.

I'll bow out of this thread and let you focus on the clock synchronization issues.


I have a more readable version and less obsfuscated version, and had fun in reading the original one .

[off]For higher level of obfuscation, see http://www.ioccc.org/2013/mills/mills.c and all IOCCC 2013 winning entries.[/off]

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following user says Thank You to sam028 for this post:
 
  #52 (permalink)
Elite Member
Manchester, NH
 
Futures Experience: Beginner
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: Stocks
 
Posts: 902 since Jul 2012
Thanks: 603 given, 1,785 received


sam028 View Post

I have a more readable version and less obsfuscated version, and had fun in reading the original one .

[off]For higher level of obfuscation, see http://www.ioccc.org/2013/mills/mills.c and all IOCCC 2013 winning entries.[/off]

I figured it wouldn't take long to find someone who can decipher the code here.

Reply With Quote
 
  #53 (permalink)
Elite Member
Paris
 
Futures Experience: None
Platform: NinjaTrader
 
Posts: 1,176 since Oct 2009
Thanks: 227 given, 4,092 received


Just a few off topic points on clock management in Windows with (or without) NTP.

I made a lot of tests with NTP and my conclusion is that
* I requires symmetrical latency ( not available on ADSL because of the A)
* I required low latency jitter (not the case at on a DSL network, if you make an NTP query and your PC is busy downloading, you'll be off by tens or hundreds of milliseconds)

Because of its huge time constants it also requires a stable clock speed ie constant temperature (not the case in a PC, because of room temperature or PC load)

I tried lots of builds, selected specific NTP low stratum servers, but the NTP feedback loop never stabilized because of the PC and network non ideal configurations.


So I bought a cheapo GPS card and plugged it in my PC through the serial port (to get the GPS very precise pulse called PPS)

To manage my clock built a C program that uses a very simple algo : if PC ahead of time the put clock in "slow" mode, else put PC in "fast" mode

Before Windows 8 you had to use peformance counters to build a precise clock estimate, now with Windows 8 you can call GetSystemTimePreciseAsFileTime which will give you nanosec precision time. It makes all the clock stuff coding much more easier.....

Of course it's much more simpler to use a NTP daemon with the GPS clock , but I got fed with NTP so built my own...

Here's the result, you see you can have much lower than ms precision with a very basic gps board (with PPS)
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I you choose to go with the hardware way, it's better to use a legacy serial port, which has a direct IRQ access to the CPU, than going through the full serial over usb stack.


Last edited by gomi; February 16th, 2014 at 03:32 PM.
Reply With Quote
The following 3 users say Thank You to gomi for this post:
 
  #54 (permalink)
Elite Member
Paris
 
Futures Experience: None
Platform: NinjaTrader
 
Posts: 1,176 since Oct 2009
Thanks: 227 given, 4,092 received

You can also watch OS latency and check for rogue drivers using latencymon
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following 5 users say Thank You to gomi for this post:
 
  #55 (permalink)
Elite Member
@ Germany
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: FDAX
 
Posts: 440 since Nov 2011
Thanks: 254 given, 369 received


gomi View Post
Just a few off topic points on clock management in Windows with (or without) NTP.

I made a lot of tests with NTP and my conclusion is that
* I requires symmetrical latency ( not available on ADSL because of the A)
* I required low latency jitter (not the case at on a DSL network, if you make an NTP query and your PC is busy downloading, you'll be off by tens or hundreds of milliseconds)

Because of its huge time constants it also requires a stable clock speed ie constant temperature (not the case in a PC, because of room temperature or PC load)

I tried lots of builds, selected specific NTP low stratum servers, but the NTP feedback loop never stabilized because of the PC and network non ideal configurations.


So I bought a cheapo GPS card and plugged it in my PC through the serial port (to get the GPS very precise pulse called PPS)

To manage my clock built a C program that uses a very simple algo : if PC ahead of time the put clock in "slow" mode, else put PC in "fast" mode

Before Windows 8 you had to use peformance counters to build a precise clock estimate, now with Windows 8 you can call GetSystemTimePreciseAsFileTime which will give you nanosec precision time. It makes all the clock stuff coding much more easier.....

Of course it's much more simpler to use a NTP daemon with the GPS clock , but I got fed with NTP so built my own...

Here's the result, you see you can have much lower than ms precision with a very basic gps board (with PPS)
Attachment 137497

I you choose to go with the hardware way, it's better to use a legacy serial port, which has a direct IRQ access to the CPU, than going through the full serial over usb stack.

Thanks GOMI, thats exact my current way to solve this issue. In the meantime i've received all things to build my own stratum 1 GPS based time source (with PPS of course). To overcome windows time granularity issues i access the time in a direct way. Network path to my local device is very symmetric.

Reply With Quote
The following user says Thank You to Koepisch for this post:
 
  #56 (permalink)
Elite Member
Paris
 
Futures Experience: None
Platform: NinjaTrader
 
Posts: 1,176 since Oct 2009
Thanks: 227 given, 4,092 received

If your clock is correctly set up, you can use GomTimeMeasureV2 to watch time distribution on tick arrivals


3 tick modes : Last, BidAsk, All (Hotkey Space Bar)
This allows to check if the time distrubution is constant depending on tick types.

2 visualisation modes : Basic and Convolution
The problem is that NT has 1 second resolution, so to find real latency, we use a sliding convolution window of 1 second, and we try to see which starting time of the window captures the maximum ticks. This will give the latency.

If network latency is constant, the convolution should be triangular.

In basic mode, the point which is the most to the left is the minimum measured network lag (based on data feed timestamp)

You can move the chart around by using Ctrl+click and move.


Here's an example
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


We can see that :
shortest lag on dax is 200 ms
shortest lag on ES is 170 ms

mean network las is 270 ms.

Bid/Ask ticks have greater lag than Price ticks, so you may need to throw all the delta stuff away ;-)

Attached Files
Register to download File Type: zip GomTimeMeasureV2.1.zip (3.8 KB, 24 views)
Reply With Quote
The following 7 users say Thank You to gomi for this post:
 
  #57 (permalink)
Elite Member
@ Germany
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: FDAX
 
Posts: 440 since Nov 2011
Thanks: 254 given, 369 received


gomi View Post
If your clock is correctly set up, you can use GomTimeMeasureV2 to watch time distribution on tick arrivals


3 tick modes : Last, BidAsk, All (Hotkey Space Bar)
This allows to check if the time distrubution is constant depending on tick types.

2 visualisation modes : Basic and Convolution
The problem is that NT has 1 second resolution, so to find real latency, we use a sliding convolution window of 1 second, and we try to see which starting time of the window captures the maximum ticks. This will give the latency.

If network latency is constant, the convolution should be triangular.

In basic mode, the point which is the most to the left is the minimum measured network lag (based on data feed timestamp)

You can move the chart around by using Ctrl+click and move.


Here's an example
Attachment 137533

We can see that :
shortest lag on dax is 200 ms
shortest lag on ES is 170 ms

mean network las is 270 ms.

Bid/Ask ticks have greater lag than Price ticks, so you may need to throw all the delta stuff away ;-)

Thanks a lot @gomi for your contributions. I have to re-read your post a few times and look into the NT code. Till now i haven't had an idea to utilize NT for that issue due to lack of exchange time stamps. If i got an access to rithmic API (pending since several day's) i want to compare my time to the R|API exchange time stamps. So it would be a big improvement if i could utilize a second datafeed to make the measurements.

Reply With Quote
 
  #58 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received


gomi View Post
If your clock is correctly set up, you can use GomTimeMeasureV2 to watch time distribution on tick arrivals


3 tick modes : Last, BidAsk, All (Hotkey Space Bar)
This allows to check if the time distrubution is constant depending on tick types.

2 visualisation modes : Basic and Convolution
The problem is that NT has 1 second resolution, so to find real latency, we use a sliding convolution window of 1 second, and we try to see which starting time of the window captures the maximum ticks. This will give the latency.

If network latency is constant, the convolution should be triangular.

In basic mode, the point which is the most to the left is the minimum measured network lag (based on data feed timestamp)

You can move the chart around by using Ctrl+click and move.


Here's an example
Attachment 137533

We can see that :
shortest lag on dax is 200 ms
shortest lag on ES is 170 ms

mean network las is 270 ms.

Bid/Ask ticks have greater lag than Price ticks, so you may need to throw all the delta stuff away ;-)

@gomi never fails to come up with something new. just amazing

here's an example from the other side of the atlantic:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


and thank you for this brilliant tool!!

Reply With Quote
The following 2 users say Thank You to Silvester17 for this post:
 
  #59 (permalink)
Elite Member
@ Germany
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: FDAX
 
Posts: 440 since Nov 2011
Thanks: 254 given, 369 received

@gomi: I haven't grasb it yet. You said "we use a sliding convolution window of 1 second, and we try to see which starting time of the window captures the maximum ticks" - is that related to the assumption that the most ticks are at the very beginning of a new second?

Reply With Quote
 
  #60 (permalink)
Elite Member
Paris
 
Futures Experience: None
Platform: NinjaTrader
 
Posts: 1,176 since Oct 2009
Thanks: 227 given, 4,092 received


Suppose you have a constant latency of 150 ms.
Then the measured latency should be equally distributed between 0.150 s (ticks happening at mm:ss.000, timestamped mm:ss ), and 1.150 s (ticks happening at mm:ss.99999999999, also timestamped mm:ss).

The idea is you take the histogram of all latencies, and you cumulate it using a sliding window of 1 second length.
So you calculate how much ticks you have between
0 and 1
0.10 and 1.10
0.20 and 1.20
etc....

The window that catches the maximum of ticks will be the one that represents the latency.
Here's a chart, the blue reactangle is where the measured tick latencies are.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Last edited by gomi; February 17th, 2014 at 12:40 PM.
Reply With Quote
The following 2 users say Thank You to gomi for this post:

Reply



futures io > > > How to measure data feed latencies between continents?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best data feed for stocks Day Trading Fool Reviews of Brokers and Data Feeds 10 August 7th, 2016 10:54 AM
Data Feed: How do you confirm Accuracy vs Historical tick data provided. FAUGH45568 Reviews of Brokers and Data Feeds 2 February 14th, 2013 07:04 PM
WHat data feed for ICE US Data? samadams Reviews of Brokers and Data Feeds 7 September 20th, 2012 04:08 PM
A better retail data feed LittleCatJones Elite Automated Trading 6 April 27th, 2012 11:52 AM
Data feed comparison - tick data Big Mike Reviews of Brokers and Data Feeds 6 March 18th, 2010 01:52 PM


All times are GMT -4. The time now is 08:46 PM.

Copyright © 2017 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
Page generated 2017-12-13 in 0.16 seconds with 40 queries on phoenix via your IP 54.160.245.121