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:5,989 / 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?

  #61 (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
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.
Attachment 137538

Thanks, now i've got it!

Reply With Quote
 
  #62 (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: You wrote "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."

My current implementation idea was to send one UDP packet per second. I want to avoid to utilize a new serial port driver (did you need one?) and i think the network stack adds only very little latency. Was this an option within your solution? I can attach my stratum source to the serial port too, but i don't know if this is a legacy port (have to look into the motherboard spec first). I have more knowledge to handle IP data then serial port access.

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


If I understand you will be building a dedicated NTP server on PI box ?
In this case, you will need some way to discipline your local PC clock (make it slew faster/slower)

Since you're on a LAN (constant network latency), I would leave this to a local NTP client..

Reply With Quote
 
  #64 (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 I understand you will be building a dedicated NTP server on PI box ?
In this case, you will need some way to discipline your local PC clock (make it slew faster/slower)

Since you're on a LAN (constant network latency), I would leave this to a local NTP client..

No not anymore. NTP is out of the game. I can achieve much more precision with doing it myself and i can keep control. Adjusting the timer frequency is one part of the game. I want to send a UDP packet (not NTP) to my PC and the (my) client handles the windows time sync (like yours) OR use the time information directly.

Using the PC serial port instead of using ethernet can reduce the hardware design a lot. The PI box is only for fast development. Later i can attach a small atmel avr. That's why i asked about the serial port.

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

I didn't really think to use a network stack as my GPS card was serial ;-)

Using a serial port is easy, you just set up a mask
SetCommMask(hPort, EV_RLSD | EV_ERR | EV_RXCHAR);

An wait for the interrupt
WaitCommEvent(hPort, &dwCommModemStatus, 0);

FYI here's my code, you need Windows 8 because of GetSystemTimePreciseAsFileTime
But you can replace with GetSystemTimeAsFileTime if needed to compile on pre-Win8.

I also have some Win 7 code that will do interpolation with performance counters if you need.


Code will set thread affinity on one core only and set real time priority.

Attached Files
Register to download File Type: cpp main.cpp (6.9 KB, 10 views)
Reply With Quote
 
  #66 (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
I didn't really think to use a network stack as my GPS card was serial ;-)

Using a serial port is easy, you just set up a mask
SetCommMask(hPort, EV_RLSD | EV_ERR | EV_RXCHAR);

An wait for the interrupt
WaitCommEvent(hPort, &dwCommModemStatus, 0);

FYI here's my code, you need Windows 8 because of GetSystemTimePreciseAsFileTime
But you can replace with GetSystemTimeAsFileTime if needed to compile on pre-Win8.

I also have some Win 7 code that will do interpolation with performance counters if you need.


Code will set thread affinity on one core only and set real time priority.

Thanks a lot gomi. You can help me out with the Win7 code, if you are willing to share it. Now it's family time, so i will look into the code at later time. But i'm looking forward to do it. I think we had the same needs and it resolves in the same solution. Awesome!

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

Here's the Win7 code. To make it work with good precision, the code will compute a corrective scale factor for performance counter frequency, using an EMA(100) of measured values.

Be prepared to see some ugly stuff, never planned to make it public ;-)
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Attached Files
Register to download File Type: cpp main.cpp (8.6 KB, 17 views)
Reply With Quote
The following 3 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)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

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 07:59 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-12 in 0.10 seconds with 34 queries on phoenix via your IP 54.234.255.29