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)




"For anyone considering using DTN.IQ for a data feed, my experience with the quality of data and the tech support has been very positive." - Comment from Public Forum
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"As a past ******* customer(and not a happy one), IQ Feed by DTN is a much better and cheaper product with great customer support. I have had no problems at all since switching over." - Comment from Public Forum
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"I'm very glad I switched to IQFeed. It's working perfectly with no lag, even during fast market conditions." - Comment from Andy via Email
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"I will tell others who want to go into trading that DTN ProphetX is an invaluable tool, I don't think anyone can trade without it..." - Comment from Luther
"If you are serious about your trading I would not rely on IB data for serious daytrading. Took me a while to justify the cost of IQ Feed and in the end, it's just a 2 point stop on ES. Better safe than sorry" - Comment from Public Forum
"Just a quick one to say I'm very impressed so far :) The documentation for developers is excellent and I've quickly managed to get an app written to do historical downloads. The system is very robust and pretty quick considering the extent of data that's available. The support guys have been very helpful too, in combination with the forums it's been plain sailing so far!" - Comment from Adam
"The service is great, I see a noticeable improvement in my volume profiles over [broker]'s data feed" - Comment from Larry
Home  Search  Register  Login  Recent Posts

Information on DTN's Industries:
DTN Oil & Gas | DTN Trading | DTN Agriculture | DTN Weather
Follow DTNMarkets on Twitter
DTN.IQ/IQFeed on Twitter
DTN News and Analysis on Twitter
»Forums Index »IQFeed Developer »IQFeed Developer Support »Can I get the most recent quote for a symbol, not streaming data?
Author Topic: Can I get the most recent quote for a symbol, not streaming data? (12 messages, Page 1 of 1)

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Aug 27, 2020 10:08 PM          Msg. 1 of 12
How can I request just 1 quote on a symbol? or do I have to subscribe, wait for some quotes, unsubscribe?

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 167
Joined: Jul 3, 2019


Posted: Aug 28, 2020 02:09 PM          Msg. 2 of 12
If you just want the most recent tick, you can send this command to the history port (9100):

HTX,SYMBOL,1

This will return the most recent tick for the symbol specified. You can retrieve the Last from it. If you're looking for something different, let me specifically what data point(s) you want and I can make another suggestion.

EDITED TO ADD: I should point out that this command will return non-qualified trades, which cannot set an official Last, High, Low, or Close. Again, let me know exactly what you want and I can suggest a specific approach.




Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Aug 28, 2020 at 02:13 PM
Edited by DTN_Gary_Stephen on Aug 28, 2020 at 02:29 PM

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Aug 28, 2020 06:15 PM          Msg. 3 of 12
Thanks Gary. That looks like what I needed.

Until you set the protocol, HTX works on some symbols but not others. A bug?

 
HTX,ZSL,1
2020-08-28 19:01:42,7.3800,350,1744488,7.3500,7.3800,826423094,0,0,E,
!ENDMSG!,

HTX,IBM,1
!ENDMSG!,

S,SET PROTOCOL,6.1
S,CURRENT PROTOCOL,6.1

HTX,IBM,1
2020-08-28 19:04:37.451031,125.3000,30,3099795,125.0900,125.3000,1246452042,O,19,8717,0,28,
!ENDMSG!,

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 167
Joined: Jul 3, 2019


Posted: Aug 31, 2020 09:37 AM          Msg. 4 of 12
Andrew,

What's happening in your IBM example actually has to do with the command, not the symbol.
In general, protocols have nothing to do with symbols or exchanges. Only with commands, and how those commands behave.

Here's a test request I made:

(with default protocol 4.9)
HTX,IBM,10
2020-08-31 10:04:58,124.2284,100,485546,124.2200,124.2800,910373954,0,0,C,
2020-08-31 10:04:58,124.2300,100,485445,124.2200,124.2800,808545882,0,0,C,
2020-08-31 10:04:57,124.2500,100,485334,124.2300,124.2800,1463249239,0,0,C,
!ENDMSG!,

S,SET PROTOCOL 6.1
S,CURRENT PROTOCOL,6.1
HTX,IBM,10
2020-08-31 10:05:07.206241,124.1900,99,487698,124.1900,124.2300,1229273419,O,19,87,0,31,
2020-08-31 10:05:07.180500,124.2100,1,487599,124.1900,124.2300,1565424203,O,153,87,0,31,
2020-08-31 10:05:06.641954,124.2100,100,487598,124.1900,124.2300,808546112,C,18,01,0,31,
2020-08-31 10:05:06.641740,124.2100,100,487498,124.1900,124.2300,977154111,C,5,3D,0,31,
2020-08-31 10:05:06.641528,124.2100,200,487398,124.1900,124.2300,808546111,C,18,3D,0,31,
2020-08-31 10:05:05.630828,124.2100,100,487198,124.1800,124.2100,1229214799,C,19,01,0,31,
2020-08-31 10:05:05.424824,124.2100,100,487098,124.1800,124.2100,977100123,C,5,01,0,31,
2020-08-31 10:05:04.940758,124.2050,4,486998,124.1800,124.2300,1533632367,O,153,87,0,31,
2020-08-31 10:05:04.931590,124.2050,2,486994,124.1800,124.2300,1533625136,O,153,87,0,31,
2020-08-31 10:05:04.762458,124.2000,1,486992,124.1900,124.2300,808602184,O,26,3D87,0,31,
!ENDMSG!,

I get 3 responses in protocol 4.9, but 10 in protocol 6.1. What's the difference? The difference is in how the HTX command works in protocol 4.9 compared to 6.1.

http://www.iqfeed.net/dev/api/docs/docs51/HistoricalviaTCPIP.cfm says this about the response to HTX in Protocol 4.9:

Quote: Basis For Last Character Possible single character values include:
C - Last Qualified Trade.
E - Extended Trade = Form T trade.
NOTE: New values may be added in the future.


If you look at protocol 5.0 on the same page, O, Other Trades were added to the type of trades that HTX returns. S, Settles (for commodities) were added in protocol 5.2. Those are the four types of ticks the HTX command currently returns in 6.1.

So here's what's happening: when you send the HTX command in protocol 4.9, it only returns C and E trades, and the others are ignored. When you send the same command in protocol 6.1, it returns Setttles and Other trades in addition to C and E. If you look at my 10 ticks above, some are C, and some are O (which I would not get into protocol 4.9).

When you sent HTX,IBM,1 in protocol 4.9, you got no response, because the most recent trades was not a C or E. If you'd done it at a time when the most recent tick was C or E, you would have gotten it.



Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Aug 31, 2020 at 09:39 AM

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Sep 2, 2020 09:24 AM          Msg. 5 of 12
Those HTX messages give me the last trade price. I also need the most recent bid & ask. Is there a way to request only the most recent L1 Summary Message?

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 167
Joined: Jul 3, 2019


Posted: Sep 3, 2020 07:36 AM          Msg. 6 of 12
If you only need the most recent Bid and Ask - and you don't need it on an ongoing basis - a historical HTX command will work.

HTX,AAPL,1
2020-09-02 14:53:23.319623,130.8698,379,167406211,130.8400,130.8700,397564,C,19,01,0,2,
!ENDMSG!,

This returns the most recent tick for that symbol. Please note that this will occasionally return !NO_DATA!, because HTX only returns Last Qualified, Extended, and Other trades, and sometimes the most recent tick isn't one of those. If you're writing code around this approach, you'll have to account for that possibility.

If you want to get regular Bid and Ask updates on some symbols, you can follow the symbol, and send an UPDATE command that will only return Bid and Ask. If you want to do this for an entire exchange, one of the Market Summary commands would be your best option.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Sep 3, 2020 05:57 PM          Msg. 7 of 12
The problem with HTX for bid/ask is it's the bid/ask at the time of the last trade so in this case it's a month old:

HTX,FAS2018I10,1
2020-08-03 12:03:13.727032,25.35,1,3,25.35,25.55,45940803,C,150,20,0,3, !ENDMSG!,

Looking at EDS, FDS and 5MS summary messages they say:

[Security Type] - Required – A number representing the desired security type. (Futures, equities, spots)

Are those the only 3 supported security types? I need equity options. Ideally I'd like to request an entire options chain based on the underlying ticker and get back the current BBO for each contract.

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


Posted: Sep 4, 2020 09:07 AM          Msg. 8 of 12
Andrew, the 5min files are really your best bet here for that many symbols. Trying any other method will be problematic at best.

Most security types are represented in these files but not all security type/exchange groups have symbols.

The IEOPTIONS file is retrieved using exchange group 14.

-edit- switched "security type 14" to "exchange group 14"

Also, if you aren't already aware, a list of security types and listed markets/exchange groups can be retrieved from the lookup port.
Edited by DTN_Steve_S on Sep 4, 2020 at 09:09 AM

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Sep 6, 2020 01:56 PM          Msg. 9 of 12
Are the fields "Open,High,Low,Close" in these 5 min files the OHLC values for the full day? They're not the 5-min bar OHCL values, right?

Is any bid or ask value shown sure to be from the current trading day because any bids/offers resting in the book are cancelled at EOD?

Could you add bid-time and ask-time fields to these files?

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 167
Joined: Jul 3, 2019


Posted: Sep 9, 2020 08:48 AM          Msg. 10 of 12
I believe they are the OHLC for each 5-minute bar, but I will confirm that. I also think any Bid or Ask shown is from that 5-minute period, meaning that is from the same day (because the 5-minute bars start/end at midnight and do not split across days).

How would Bid Time and Ask Time fields work for a 5-minute summary? Are you wanting to know the time of the peak Bid and Ask within each 5-minute bar?

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

andrewm
-Interested User-
Posts: 29
Joined: Feb 23, 2015


Posted: Sep 9, 2020 08:58 AM          Msg. 11 of 12
Bid and ask time would just be the update time of the value. If a bid is updated at 10am and I generate a 5-min summary 2 hours later that file generated at noon would show 10:00 bid time. If there have been no bids or offers that day the bid or ask value and time would show an empty field ",," not a zero value ",0,"

Please let me know if those bid/ask values carry over from previous 5-min periods. Thanks a lot.

DTN_Gary_Stephen
-DTN Evangelist-
Posts: 167
Joined: Jul 3, 2019


Posted: Sep 9, 2020 09:31 AM          Msg. 12 of 12
The values you see in a 5MS report are the same values you would see if you were watching the symbols on the level 1 port at the time the snapshot was taken. In other words, the 5MS reports are the Summary (P,) message you would get if you followed the symbol at that moment.

As a result, the OHLC are for the current day up to that point, with Close being the previous day until the current day is actually closed. Bid/ask would also be current values. Any bid/ask values that aren’t cleared out by the exchange overnight would still be there the following morning (because they are still valid). So in that way, it is possible for a Bid/Ask to be from a previous day.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist
 

 

Time: Sat January 23, 2021 8:02 AM CFBB v1.2.0 31 ms.
© AderSoftware 2002-2003