Join the 80,000 other DTN customers who enjoy the fastest, most reliable data available. There is no better value than DTN!

(Move your cursor to this area to pause scrolling)




"You are much better than lawyers or the phone company because you answer the phone when I call! I just love your customer service." - Comment from Isreal
"The service is great, I see a noticeable improvement in my volume profiles over [broker]'s data feed" - Comment from Larry
"You are either overstaffed or people just don't have problems with your feed because customer support always answers the phone quickly." - Comment from Jay via Email
"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from Public Forum
"The people at Nirvana have very nice things to say about your company and I can see why! Price and service is a potent combination." - Comment from Ed
"Version 4.0.0.2 has been working well for me and I appreciate that it is now a much tighter client to work with. I feel I can go to press with my own application and rely on a stable platform" - Comment from David in IA.
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"I just wanted to say how happy I am with your service. I was able to download the API docs last week and I was able to replicate Interactive Brokers historical bar queries and realtime bar queries over the weekend. That was about one of the fastest integrations that I've ever done and it works perfectly!!!!" - Comment from Jason via Email
"I started a trial a few weeks back before the market went wild. DTN.IQ didn’t miss anything and beat my other provider. I decided to stay with you because of the great service through all the volatility." - Comment from Mike
"I just wanted to let you know how fast and easy I found it to integrate IQFeed into our existing Java code using your JNI client. In my experience, such things almost never go so smoothly - great job!" - Comment from Nate
Home  Search  Register  Login  Blogs Recent Posts

Information on Various DTN Products:
DTN IQFeed | DTN ProphetX | DTN Ag | NxCore
Follow DTN_IQFeed on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »IQFeed Developer »IQFeed Developer Support »Decoding Timestamps in Update Messages.
Author Topic: Decoding Timestamps in Update Messages. (7 messages, Page 1 of 1)

Craig
-DTN Evangelist-
Posts: 212
Joined: Apr 16, 2010


Posted: Sep 20, 2017 05:59 PM          Msg. 1 of 7
I've switched to using the timestamps in the feed as opposed to local timestamps.
But I'm now getting out of order times. My algorithm is as follows...

* If the "Message Contents" contains "C" use the last trade time.
* else if the "Message Contents" contains "b" use the bid time.
* else if the "Message Contents" contains "a" use the ask time.

This seems straight forward, but is obviously incorrect.
Could I receive a "Message Contents" with a "C" where the Bid or Ask time is after the trade time?
...or an "Message Contents" with a "b" but the ask time is greater than the bid time?

How should I use the "Message Contents" in general to figure out what timestamp to assign a quote?

DTN_Tim Walter
-DTN Guru-
Posts: 1036
Joined: Apr 25, 2006


Posted: Yesterday @ 11:46 AM          Msg. 2 of 7
Ok, 2 assumptions up front, if either of these is not true, just let me know.
You are using "Last Trade Time" and not "Most Recent Trade Time"
You are only comparing messages of a single symbol.

Assuming both of those things, the logic you are using makes sense to me. Can you just send me an example and I will take a look? If you could include which protocol you are using and what your field order is that would certainly help.

Tim

Craig
-DTN Evangelist-
Posts: 212
Joined: Apr 16, 2010


Posted: Yesterday @ 02:05 PM          Msg. 3 of 7
Hi Tim,

1) I'm using "Last Time"
2) Yep, only one symbol.

Today I've logged the L1 data, so I'll be comparing what I've recorded.
Please let me know if 1) is correct.

Craig
-DTN Evangelist-
Posts: 212
Joined: Apr 16, 2010


Posted: Yesterday @ 03:14 PM          Msg. 4 of 7
OK, here is an example: My field set is Symbol,Last,Bid,Ask,Most Recent Trade Size,Message Contents,Most Recent Trade Market Center,Bid Size,Ask Size,Last Time,Bid Time,Ask Time. The symbol is SPY.

Here is my recorded data:
27 2017-09-21 09:30:00.559 249.9000 249.89 249.90 12100 3000 100 25 FALSE
28 2017-09-21 09:30:00.559 249.9000 249.89 249.90 12100 1000 100 25 FALSE
29 2017-09-21 09:30:00.559 249.9000 249.89 249.91 12100 1100 100 25 FALSE
30 2017-09-21 09:30:00.559 249.9000 249.89 249.90 12100 100 100 25 FALSE
31 2017-09-21 09:30:00.559 249.9000 249.89 249.90 12700 100 100 25 FALSE
32 2017-09-21 09:30:00.559 249.9000 249.89 249.90 13200 100 100 25 FALSE
33 2017-09-21 09:30:00.559 249.9000 249.89 249.90 17100 100 100 25 FALSE
34 2017-09-21 09:30:00.565 249.9000 249.89 249.90 13200 100 100 25 FALSE
35 2017-09-21 09:30:00.565 249.9000 249.89 249.90 13100 100 100 25 FALSE
36 2017-09-21 09:30:00.565 249.9000 249.89 249.90 10500 100 100 25 FALSE

---> Timestamp jumps back.

37 2017-09-21 09:30:00.556 249.8975 249.89 249.90 10500 100 100 19 TRUE
38 2017-09-21 09:30:00.559 249.8800 249.89 249.90 10500 100 500 11 TRUE
39 2017-09-21 09:30:00.559 249.8950 249.89 249.90 10500 100 200 11 TRUE

Now the L1 data from IQFeed.

Q,SPY,249.9000,249.8900,249.9000,100,ba,25,12100,3000,09:30:00.545301,09:30:00.559047,09:30:00.559047,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,12100,1000,09:30:00.545301,09:30:00.559077,09:30:00.559077,
Q,SPY,249.9000,249.8900,249.9100,100,ba,25,12100,1100,09:30:00.545301,09:30:00.559107,09:30:00.559107,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,12100,100,09:30:00.545301,09:30:00.559261,09:30:00.559261,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,12700,100,09:30:00.545301,09:30:00.559797,09:30:00.559797,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,13200,100,09:30:00.545301,09:30:00.559954,09:30:00.559954,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,17100,100,09:30:00.545301,09:30:00.560185,09:30:00.560185,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,13200,100,09:30:00.545301,09:30:00.566021,09:30:00.566021,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,13100,100,09:30:00.545301,09:30:00.566318,09:30:00.566318,
Q,SPY,249.9000,249.8900,249.9000,100,ba,25,10500,100,09:30:00.545301,09:30:00.566496,09:30:00.566496,
Q,SPY,249.8975,249.8900,249.9000,100,C,19,10500,100,09:30:00.556657,09:30:00.566496,09:30:00.566496,

--> Here is the trade, note trade time 09:30:00.556657 is before the previous Bid/Ask update time (09:30:00.566496)

Q,SPY,249.8975,249.8900,249.9000,8,O,11,10500,100,09:30:00.556657,09:30:00.566496,09:30:00.566496,
Q,SPY,249.8800,249.8900,249.9000,500,C,11,10500,100,09:30:00.559100,09:30:00.566496,09:30:00.566496,
Q,SPY,249.8950,249.8900,249.9000,200,C,11,10500,100,09:30:00.560176,09:30:00.566496,09:30:00.566496,

Please advise.

Craig
-DTN Evangelist-
Posts: 212
Joined: Apr 16, 2010


Posted: Today @ 01:45 PM          Msg. 5 of 7
Any updates here?

DTN_Steve_S
-DTN Guru-
Posts: 2026
Joined: Nov 21, 2005


Posted: Today @ 02:18 PM          Msg. 6 of 7
Craig, sorry for the delay in responding.

What you are showing here is expected behavior. The bid/ask quotes for these equities come from the exchange on a different feed and we merge them in-house before forwarding them to customers. Any effort to assure they are in chronological order would result in intentionally delaying at least one of the feeds while waiting for data from the other feed. Instead, we opt for the option that gets data to customers as quickly as possible. As a result, you will occasionally see discrepancies between trades timestamps and bid/ask timestamps in this scenario.

Craig
-DTN Evangelist-
Posts: 212
Joined: Apr 16, 2010


Posted: Today @ 02:37 PM          Msg. 7 of 7
Thank you Steve, when you say 'different feed', do you mean different exchanges?
If this is the case should the time-stamps be chronological by market center?
 

 

Time: Fri September 22, 2017 3:44 PM CFBB v1.2.0 16 ms.
© AderSoftware 2002-2003