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)

"And by the way, have to say this. I love the IQFeed software. It's rock solid and it has a really nice API." - Comment from Thomas via RT Chat
"I was with ******* for 4 years at $230 a month, this is a huge savings for me, GOD BLESS YOU PEOPLE," - Comment from T.S. via Email
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"I've been using IQFeed 4 in a multi-threaded situation for the last week or two on 2600 symbols or so with 100 simultaneous daily charts, and I have had 100% responsiveness." - Comment from Scott
"Boy, probably spent a thousand hours trying to get ******* API to work right. And now two hours to have something running with IQFeed. Hmmm, guess I was pretty stupid to fight rather than switch all this time. And have gotten more customer service from you guys already than total from them… in five years." - Comment from Jim
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"I just wanted to let u know that your data feed/service is by far the best!!! Your unfiltered tick data is excellent for reading order flow and none of your competitors delivers this quality of data!" - Comment from Peter via Email
"I'm satisfied with IQFeed. It's the most reliable and fastest quote feed I have ever used. Although I'm a resident in China, it's still very fast!" - Comment from Xiaofei
"If you want customer service that answers the phone, your best bet is IQFeed. I cannot stop praising them or their technical support. They are always there for you, and they are quick. I have used ****** too but the best value is IQFeed." - Comment from Public Forum
"This is an excellent value, the system is generous (allowing for 500 stocks) and stable (and really is tick-by-tick), and the support is fantastic." - Comment from Shirin via Email
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
Viewing User Profile for: DTN_Gary_Stephen
About Contact
Joined: Jul 3, 2019 11:09 AM
Last Post: Today @ 07:59 AM
Last Visit: Today @ 07:59 AM
Yahoo IM:
Post Statistics
DTN_Gary_Stephen has contributed to 270 posts out of 20690 total posts (1.30%) in 1,191 days (0.23 posts per day).

20 Most recent posts:

When you set the update interval to anything above 0, you will get more BU messages. A BU message is an update to the bar, which does not necessarily mean the bar is complete. A BC message tells you that the bar is complete, but as I said, it will only appear once a tick after the bar has occurred (which may not be immediate, especially for less-frequently traded symbols). But you can watch the BU messages, and compare them to the time to know that a bar has passed without having to wait for the BC message.

By the way, BU messages can also appear when a past bar is updated, usually because a tick has been updated and this changes the bar totals in some way.

Gary Stephen
DTN IQFeed Implementation Support Specialist


DTN does not maintain standards for how long a request "should" take. Transaction time can vary a great deal, depending upon your own internet connection, how much data you're requesting at once, how busy the markets are, and other factors.

Also, when it comes to the streaming interval bars, there is a relevant parameter called Update Interval. If this is set to 0 (or left at default), then a bar will not be closed until a tick after the bar has occurred. If you're doing one minute bars, the BC (bar complete) message for the bar ending at 10:00 o'clock will not be sent until a tick after 10:00:00 occurs. This can make BC messages appear to take longer to arrive. If you set update interval to one second or any amount of time that isn't 0, you will receive a BU (bar update) message anytime a change to the bar happens that has not already been sent. This will ensure that you always have the most recent information, even if a BC message has not been sent yet.

I hope this information is helpful!

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Oct 4, 2022 at 10:45 AM

The "Tick" field explicitly tells you if the current tick is up, down, or no change from the most recent last qualified trade. If you are storing the value of each tick, you can determine this yourself if you want to, but keep in mind the tick field only applies to last-eligible trades. The Message Contents field will tell you which ones these are. (Or you can use Last instead of Most Recent, which will only return last-eligible trades).

As for trade aggressor, this field can contain information you can't simply infer your self. The CME and ICE exchanges will explicitly report who the trade aggressor is in a given trade. For other exchanges, this can usually be inferred by comparing the last price to the bid and ask price. So if you're not using the trade aggressor field, you're not getting the explicit trade aggressor information ICE and CME provide.

So Trade Aggressor does include some information you can't just infer for ICE and CME exchanges.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » How to create bar from tick data Jul 25, 2022 08:13 AM (Total replies: 2)

There's already a command that will build live bars for you: Streaming Intervals Bars (BW). Connect to port 9400 and send BW,Symbol,Interval in Seconds,Begin Date/Begin Time. This will give you history up to the current moment, then new incoming ticks as they happen. goes into more detail.

If you want to build them yourself, there are a few considerations:

1. IQFeed only uses Last-Eligible and Extended ticks to build bars, ignoring Other. The Message Contents field in each ticks will tell you which it is.
2. Volume willl not consistently match the sum of all ticks. This is because Volume can include transactions that aren't ticks, like stock options and implied trades.
3. Make sure you know the difference between "Last" "Most Recent" and "Extended":
- “Last” includes only last -eligible trades.
- “Most Recent” includes all trades.
- “Extended” includes on extended trades (also call Form T or after hours trades).

You would have to consider both "Last" and "Extended" data to re-create bars as IQFeed builds them.

4. You can get tick data on premarket session, but you must be watching the "Extended" fields. "Last" includes only last-eligible trades, which do not occur outside of regular trading hours. These distinctions apply to the fields listed in You can view the one(s) you need.

I hope this is all helpful!

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » determine is options symbol has "zero bid" Jul 12, 2022 01:18 PM (Total replies: 2)

What exactly do you mean by "zero bid"? A bid with a price of 0, or that no bids exist?

IQfeed level 1 ticks (live or historical) will include the bid and ask price of each tick.

Depending on how much detail you want and what type of symbol it is (CME, ICE, another exchange) you can get Market By Order or Market By Price Level messages from the IQFeed Level 2 data, if you are subscribed to it.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Datafeed Wish List » Sequential Level1 and Level2 updates. Jun 24, 2022 10:12 AM (Total replies: 10)

You are correct that "obviate" was a bad choice of words on my part. I meant to say that the new features would be helpful, but they don't make it 100% possible to pair up bids and trades. This is still not feasible with L1 and L2 data as it is now.

Beyond that, DTN is currently having a discussion about this topic. Integrating the "message sequence Id" field will have some complexities, and we have to make sure it will accomplish what you expect it to. I'll post more on this thread when I have an update.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » @ESM22 seems to be missing options Jun 21, 2022 02:14 PM (Total replies: 12)

For the record, the behavior of the Option Chains command has been improved, and users should no longer see situations like this.

Gary Stephen
DTN IQFeed Implementation Support Specialist

DTN.IQ Client Software Support » Historical Shares Outstanding Jun 20, 2022 10:50 AM (Total replies: 1)

Yes, this is part of the FDS report, one of the Market Summary Reports:


If I have counted commas correctly, AAPL had 16,334,371 common shares outstanding at the end of 2022/01/28.

Gary Stephen
DTN IQFeed Implementation Support Specialist

DTN.IQ Client Software Support » Historical Pre-Market Volume Jun 20, 2022 10:23 AM (Total replies: 14)

Quote: Firstly, thanks for all of your help with this Gary. Secondly, love your last update - great idea! To confirm, will it always choose the latest tick in the range? Also, am I correct in thinking that for a multi-day request like 06/15 to 06/16, it will only pick the latest across all days, or would it return the latest per day? (if the former I can just use python to cycle through each day).

Coming back to the main problem, here's the summary of what I'm seeing...
If I update my message to send an OLD protocol like 5.1...

message = "S,SET PROTOCOL,5.1\r\nHTT,%s,20220615 000000,20220616 130000,,092900,092959\n" % sym 

... then I get a good response back: S,CURRENT PROTOCOL,5.1 - plus I get all of the info for GOOG (still testing, but specifying an old protocol seems to be working). However if I take this exact same code and the only change I make is to update the protocol from 5.1 to 6.2, then it gets weird. A) I get this error response: E,6.2 is not a valid protocol. B) I now get 1 row of data for GOOG back (before specifying protocol, I used to get 0 rows back). This feels super weird - sending 6.2 is getting an error, but at the same time it is meaning I get 1 row of data for GOOG vs 0 rows of data.

All in all, one request I'd love to make if possible would be to add a basic sample code for Python to the IQ Developer Support section. I know a lot of experienced devs use C++ & Java, but Python is quite a common entry level language so hoping it could be supported to a MVP level like opening a socket, setting protocol, submitting a request (to take off the table situations like this when I'm wondering if its my coding or the system - for this it looks like a problem with the system, both with GOOG data responding differently and with accepting the latest protocol incorrectly).

Will crack on with trying to get it working using the old 5.1 approach, and loop back if no joy (but please shout if you already know there'll be an issue with using the old protocol).

Thanks again for your help Gary, really appreciate it!

Edited by ChainsawDR on Jun 17, 2022 at 05:24 PM
--- Original message by ChainsawDR on Jun 17, 2022 05:22 PM
Quote: I correct in thinking that for a multi-day request like 06/15 to 06/16, it will only pick the latest across all days

Yes. The MaxDatapoints parameter applies to the entire command. If I ask for 1 datapoint of a two-week period, I get one datapoint total, not one datapoint per day:

HTT,AAPL,20220612 000000,20220620 130000,1,092900,092959
LH,2022-06-17 09:29:59.992136,130.0600,511,1955010,130.0600,130.0700,5783,E,5,17,0,17,

Omitting the MaxDatapoints feature will return the 9:29-9:30 time period for all days in range. Which may have other benefits: if you want to confirm the volume of the very last tick before trading begins, this may not be the very last tick before 9:30:00.000000. You can collect all ticks in a minute (or any number of seconds) and look to the Basis For Last datapoint (the E in the above example) to identify the final trade that was Extended as opposed to C (qualified) or O (other). It depends on how precisely you're defining "last."

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Datafeed Wish List » Sequential Level1 and Level2 updates. Jun 17, 2022 03:04 PM (Total replies: 10)

Protocol 6.2, which became the official release version in September 2021, has improvements to the Level 2 messages that should obviate the need for this feature.

First, keep in mind that there are two different kinds of watches: Market By Order or Market By Price Level. Market By Price Level is similar to how a "watch" worked in protocol 6.1; Order Level is a new command that returns information about each actual orders that makes up the price level. Currently this data is only available for CME and ICE futures; other symbols can be watched by Price Level.

Market By Order messages include an "Order Priority" that tells you how to prioritize orders of the same side (buy/sell) and price. Furthermore, Buy and Sell offers are each their own message, as opposed to one message potentially including both (differentiated by the BidInfoValid and AskInfoValid data points). Both Market By Order and Market By Price Level messages include a precise time/date stamp.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » MBO data & BookMap Jun 17, 2022 01:36 PM (Total replies: 1)

I don't know what exactly Bookmap means by that. IQFeed Protocol 6.2, which was officially released September of last year, offers expanded MBO capabilities. I don't know what exactly they mean by "full book and indicators", but 6.2 has "market by order" and "market by price level" commands. Previously only market by price level was available; market by order is available now for certain exchanges. This page is a good summary of IQFeed's current MBO capabilities. Beyond that I'd need to know more about what Bookmap claims IQFeed doesn't do. I can answer any questions about it.

Gary Stephen
DTN IQFeed Implementation Support Specialist

DTN.IQ Client Software Support » Historical Pre-Market Volume Jun 17, 2022 12:45 PM (Total replies: 14)

Also, I thought of a way to improve the request I suggested. If you're defining "pre market volume" as "the total volume in the last tick before 9:30 am", you can actually do this more efficiently. Make this addition:

HTT,AAPL,20220601 000000,20220609 130000,1,092900,092959

The 1 is MaxDatapoints. This will give you only one datapoint that fits the description and filter. The default order is newest to oldest, so this will give you the very last tick before 9:30. That way you don't have to retrieve all the ticks in that minute.

Note also that the EndFilterTime is 092959. This will include that entire second, up to 9:29:59.999999, which I suspect is what you want. If you make the end time 093000, ticks as late as 9:30:00.999999 will be included in the results.

I should also point out that this approach requires that some trading have occurred between 9:29 and 9:30. For heavily-traded symbols like the ones in your examples, this is a safe assumption. But for lesser-traded symbols, this approach may not always work.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Jun 17, 2022 at 03:24 PM

DTN.IQ Client Software Support » Historical Pre-Market Volume Jun 17, 2022 12:20 PM (Total replies: 14)

To answer question A: No. You must explicitly tell IQFeed API which protocol you want to use each time you connect, or it will assume the oldest one, 4.9. All you should need to do is send it a command, like your code does:

message = "S,SET PROTOCOL 6.2"

or something like:

self._send_cmd("S,SET PROTOCOL,6.2\r\n" % protocol)

You will get a response S,CURRENT PROTOCOL 6.1 confirming this has been successful. Then your HTT command for GOOG should work correctly. I'm pretty sure not doing this is your problem, since i can reproduce the failure of the GOOG command when I don't set it.

Gary Stephen
DTN IQFeed Implementation Support Specialist

DTN.IQ Client Software Support » Historical Pre-Market Volume Jun 16, 2022 04:15 PM (Total replies: 14)

I'm guessing you didn't set the protocol. The S,SET PROTOCOL command should always be set when you first connect. (If you don't do this, IQFeed API assumes you want to use the much older protocol 4.9, which does not always accept the same commands as the current protocol 6.2 does. Your GOOG command fails if I don't SET PROTOCOL 6.2 first. AMZN succeeds. To be honest I'm not 100% sure why they don't both fail, but setting protocol first should render the problem moot.

There are other possible causes I can think, but none would apply to the commands as you list them here:

- Tick data older than 8 days cannot be retrieved during trading hours. (Your GOOG command requests data no older than 7 days)
- You lack the necessary exchange subscriptions. (GOOG is a NASDAQ symbol which is included in the IQFeed core package, so everyone has it)
- If you have delayed data, you can't make history requests that would return that day. In other words, if your NASDAQ data is the standard 10-minute delay as opposed to realtime, you can't make historical requests that would circumvent that. If you try to request ticks from 9:20 to 9:29 at 9:30, you'll get no data back. The same request would work at 9:40, because the 10-minute delay would have passed by then. (You're requesting a day's worth of data so it can't all be unavailable due to delay)
- Make sure the command is being assembled correctly. (The code suggests that it is. And the same command works fine for AMZN)

Send S,SET PROTOCOL 6.2 to port 9100 after you connect and try your code again. If that doesn't sort it, I may want to review your IQConnect.txt log file.

Gary Stephen
DTN IQFeed Implementation Support Specialist


Poster altmany is correct on both counts. API commands are case-sensitive, and IncludeStandardOptions needs to be 1 to include them, or 0 to exclude. (This can also be omitted if you want 0, because that is the default.) This command should return your desired results:


Gary Stephen
DTN IQFeed Implementation Support Specialist

DTN.IQ Client Software Support » Historical Pre-Market Volume Jun 8, 2022 12:09 PM (Total replies: 14)

Depends on what you mean by "avoid making requests." There are two approaches I can suggest:

1. The EDS market summary report. It won't be timed at 9:29:59 exactly, but depending on what data you want to collect, it might meet your needs. It is available on the History/Lookup port, and the syntax is:

Report,Security Type,Group ID,Date

Security Type is the number representing the type of securities you want, such as 1 for Equities and 8 for Futures. The list of codes can be retrieved from the SST command.

Group ID is the group of exchanges you want, like 5 for NASDAQ or 34 for CME. The list of Group IDs can be retrieved from the SLM command. Each exchange contains the group it belongs to: “1,NGM,Nasdaq Global Market,5,NASDAQ” would be part of Group 5.

Date is the date in YYYYMMDD format. Date is omitted for the 5MS command.

This returns a report containing the following fields:


2. It is possible to perform a tick history request which includes "filter time", meaning it will only return data from a certain time window each day. This is usually done to retrieve ticks data only from 9:30 to 4:00. But you could make a request like this:

HTT,AAPL,20220601 000000,20220609 130000,,092900,093000

This will request all ticks from June 1, midnight through June 9, 1 PM Eastern time. But there is a BeginFilterTime and EndFilterTime, 9:29 and 9:30 respectively. So the response will only include ticks during that time:

2022-06-02 09:30:00.000812,147.8000,26,1515398,147.7900,147.9300,910,O,18,87,0,2,
2022-06-02 09:30:00.000804,147.8400,2,1515372,147.7900,147.9300,909,O,18,87,0,2,
2022-06-02 09:29:59.825505,147.8100,100,1515370,147.7500,147.9300,4682,E,5,17,0,2,
2022-06-02 09:29:59.825502,147.8100,100,1515270,147.7500,147.9300,4681,E,5,17,0,2,

And so on. The highlighted number is the Total Volume. This approach may not be optimal for what you want to collect, but it does work.

By the way: the only hard limits on API requests is 50 individual historical requests per second, and your symbol limit for Level 1 watches (typically 1400). Beyond that it's a matter of how much data your code can process.

Gary Stephen
DTN IQFeed Implementation Support Specialist


That command works successfully for me:


Without knowing more, I can think of two possible problems:

1. Are you sending the SET PROTOCOL command after you connect? This command will fail in the default protocol of 4.9.

2. Are you using the command with index/equity symbols? CEO will return NO_DATA if the symbol is not of that type, such as a future.

Hope this helps! Let me know if I can help further!

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » 5MS 5-min market summary Jun 5, 2022 04:34 PM (Total replies: 6)

The report will collect the most recent tick available, and its applicable bid/ask. The TradeDate and TradeTime fields will tell you the timestamps of the bid/ask. I don't know if there's a way to change the report's behavior, but I can ask.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » SLM returns duplicate shortname May 31, 2022 02:51 PM (Total replies: 2)

No, these should be unique. We are investigating now.

Gary Stephen
DTN IQFeed Implementation Support Specialist

The Logitech mouse utility "LGHubUpdater" is known to interfere with IQFeed, because it also uses Port 9100. Easiest solution is just to disable that app, though it is also possible to change what ports IQFeed uses via registry entries.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Time: Wed October 5, 2022 7:17 PM CFBB v1.2.0 16 ms.
© AderSoftware 2002-2003