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 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
"I am a hedge fund manager here. It’s funny, I have a Bloomberg terminal and a Bridge feed, but I still like having my DTN feed!" - Comment from Feras
"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
"I ran your IQFeed DDE vs. my broker vs. a level II window for some slow-moving options. I would see the level II quote change, then your feed update instantaneously. My broker's DDE, however, would take as much as 30 seconds to update. I am not chasing milliseconds, but half a minute is unacceptable." - Comment from Rob
"I have to tell you though that using the IQFeed API is about the easiest and cleanest I have seen for some time." - Comment from Jim
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"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
"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
"You have an excellent product !!!!!!" - Comment from Arely
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: Yesterday @ 06:30 AM
Last Visit: Yesterday @ 09:17 AM
Yahoo IM:
Post Statistics
DTN_Gary_Stephen has contributed to 74 posts out of 19569 total posts (0.38%) in 337 days (0.22 posts per day).

20 Most recent posts:
Data and Content Support » Same Timestamp with different TickID Yesterday @ 06:30 AM (Total replies: 11)

I would like to add a couple other comments about how TickID works:

- TickIDs are unique by ID, but also symbol and traded market. For example, there may exist a TickID 123456789 on NYSE and a TickID 123456789 on NASDAQ. It's also possible for two different symbols to have the same TickID. If you want to identify trades uniquely, you have to include the traded market and symbol as well. (However, see next item.)

- Furthermore, TickIDs are not necessarily unique by trade. Futures exchanges and OPRA can have the same TickID applied to multiple trades. This is because those exchanges "bundle" trades, meaning, they can send several trades at once. All bundled trades will have the same TickID. The IQFeed API "unbundles" them, so each trade has its own record, but they do have the same TickID. This is by design, so you can "rebundle" the trade data yourself if desired.

- TickIDs are not necessarily incremental, a certain number of digits, or anything like that.

- TickID is a 32-bit unsigned integer. It can be as large as 4,294,967,295 (commas added for clarity). Allow for this when creating a variable or database column to store them in.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » How to Get a List of Index Components? May 26, 2020 08:32 AM (Total replies: 2)


Currently there is no API command that will retrieve a list of components of an index.

Gary Stephen
DTN IQFeed API Support

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » Equity Tickdata has extreme outliers May 20, 2020 08:08 AM (Total replies: 9)

Yeah, that is unusual. I will have our data team investigate, and will post my findings. ETA: I see that my teammate Steve has already given an explanation below.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on May 20, 2020 at 08:34 AM

IQFeed Developer Support » Trade Aggressor always 0 May 18, 2020 09:09 AM (Total replies: 4)

Actually, let me clarify the above answer.

The API will currently show 0 as the trade aggressor for all trades on equity symbols, because the equity exchanges currently do not return Trade Aggressor data. The IQFeed apps do have a "bid/ask at trade" data point, which is based on whether the bid or ask matches the price of the trade.

For exchanges that do provide trade aggressor data, this will be a 1 for the buyer, 2 for the seller, and 3 for neither.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on May 18, 2020 at 09:40 AM

IQFeed Developer Support » Trade Aggressor always 0 May 18, 2020 08:21 AM (Total replies: 4)


Hello, this is Gary Stephen with DTN IQFeed API Support.

The INTC data looks normal to me. Not every trade has an aggressor, but most do. Can you give me an example of a request you did where there were a large number of zeroes in that field?

By the way, make sure you are sending S,SET PROTOCOL 6.1 if you want to see the trade aggressor. All earlier protocols, including the default 4.9, don't even have the Trade Aggressor field.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » Error on Invalid Login May 7, 2020 03:01 PM (Total replies: 2)

Hello, this is Gary from DTN IQFeed API Support.

You are correct that the S,SET LOGIN and S,SET PASSWORD commands in the Admin port don't validate what you send them. Validation is only done if you try to connect with an S,CONNECT command (or connection is set to happen automatically somehow). There is no explicit message associated with connection or failing to connect, however: the S,STATS message will contain either Connected or Not Connected. You could monitor that field to know if you are connected or not.

I hope this is helpful. Let me know if you have any followup questions on this!

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » Time Stamp Data Type Formatting May 5, 2020 02:40 PM (Total replies: 3)


First of all, let's talk about the protocol, because that's important to understand. When connecting to the API, you send an S,SET PROTOCOL command to indicate which version of the syntax you want to use. It's a backwards compatibility feature; whenever DTN upgrades the API, it does so in a new protocol number, so existing code may continue to specify the old protocol until they have fully upgraded to it. The most recent protocol is 6.1, so this is the version you should be requesting, by sending S,SET PROTOCOL 6.1 when you initially connect. See for more details.

There are three interval history commands:

HIX - requests a number of intervals
HID - requests all intervals over a range of days
HIT - requests all intervals over a specified date-time range

Based on the presence of num_bars=100, I suspect it is an HIX request. What actually gets sent to the API is:


Which return data in the following format:

2020-05-05 15:11:00,300.9800,300.8000,300.8200,300.9100,27132732,35293,0,
2020-05-05 15:10:00,300.9200,300.7600,300.9050,300.8100,27089316,41483,0,
2020-05-05 15:09:00,300.9600,300.8800,300.9122,300.9047,27038363,37991,0,

Getting back to your original question: the date/time already appears to be in the date format Postgres takes. I'm not familiar with Postgres but you may need to convert it to timestamp form to store it:

Quote: SELECT TO_TIMESTAMP('2017-03-31 9:30:20','YYYY-MM-DD HH:MI:SS');

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » Time Stamp Data Type Formatting Apr 30, 2020 02:10 PM (Total replies: 3)


Exactly what command are you sending to the API? No "minute bars" command should be giving you milliseconds, whether it's a history command like HIT, or a BW derivative data command. A tick request could, though, depending upon protocol. Are you specifying a protocol? If so, which one? Let me know the answers to these two questions., and I can give a more specific answer.

Gary Stephen
DTN IQFeed Implementation Support Specialist

"STC" is the API command. You connect to the History port (9100) and send "STC", followed by "/n/r" as you would any other command. The response will be a list like this:

1,REGULAR,Normal Trade,
3,CASHM,Cash Only Market,
4,BUNCHED,Bunched Trade,
5,AVGPRI,Average Price Trade,
153,LATE,LSE - Late trade,
154,STRAT,LSE - Strategy vs. Strategy Trade trade,
155,INDICATIVE_AUCT,LSE - Indicative Auction Uncrossing Data,

Gary Stephen
DTN IQFeed Implementation Support Specialist

1. I don't believe so, but I'll double check. (ETA: It varies by exchange, as the different exchanges have different ways of doing things. Our general advice to programmers is to assume that all combinations are possible.)

2. The Trade Conditions field (the last field) goes into more detail about each trade. Usually this is 01, which means REGULAR,Normal Trade. You can get a list of all these codes and what they mean by sending STC to the History port (9100). Also, you have to convert this number from hex to decimal. For example, a common Trade Condition other than 01 is 87. 87 in hex is 135 in decimal, and in the STC list 135 means ODDLOT,Odd lot trade. Again, it's possible for a trade to have more than one of these condition codes.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Apr 30, 2020 at 01:49 PM

Let me illustrate with an example:

Symbol,Most Recent Trade ,Most Recent Trade Size,Most Recent Trade Time,Most Recent Trade Market Center,Total Volume,Bid,Bid Size,Ask,Ask Size,Open,High,Low,Close,Message Contents,Most Recent Trade Conditions


Look at the next-to-last item, in Green. That is the Message Contents. That tells you what happened in this record:

C - Last Qualified Trade.
E - Extended Trade = Form T trade.
O - Other Trade = Any trade not accounted for by C or E.
b - A bid update occurred.
a - An ask update occurred.
o - An Open occurred.
h - A High occurred.
l - A Low occurred.
c - A Close occurred.
s - A Settlement occurred.
v - A volume update occurred.

In this example, it's "b", which means the bid changed. C appears if this record is a qualified trade. E or O would mean other types of trades. There can also be more than one of these letters, e.g. "ba" is an update where both a bid update and ask update occurred.

(I previously called this Trade Conditions, but the correct term is Message Contents. Trade Conditions tell you the nature of the trade. Also, Trade Aggressor tells you whether the buyer or seller initiated the trade.)

The Most Recent Trade Column will be the amount of the most recent trade. If an update is for bid/ask, or otherwise not a trade, this will stay the same:


You can see several updates to the bid (b) or ask (a), and then a trade (C). The amount happens not to have changed in this case, but it was a trade, so it gets a record. Notice that the Most Recent Trade Time changes.

In your example, yes, you will see 5 update messages. The Most Recent Trade column will contain the amount of the most recent trade; it will stay the same when an update is not a trade. The Message Contents field will tell you what is updated in each record.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Apr 30, 2020 at 10:49 AM

Quote: If I wanted to only top of the book quotes and updates. Is that included in the standard package?

I see that on each tick I get the best bid ask offer?

Yes and yes.

Quote: If the same update messages groups quote updates and tick updates. How will I know if the update message is for a top of book level 1 update or a tick trade.

Each trade has a "trade conditions" data point that will tell you the circumstances of that trade. The API command STC will give you a list of all the possible codes. A trade may have more than one of these codes.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » Volume Profile Apr 28, 2020 11:46 AM (Total replies: 1)

It's not an explicit data point, but you could calculate this from the data available. If you have a tick history, like:

Timestamp,Last,Last Size,Total Volume,Bid,Ask,TickID,Basis For Last,Trade Market ID,Trade Conditions,Trade Aggressor,Day
2020-04-28 12:44:42.994659,281.0699,20,15466795,281.0400,281.0700,41554,O,19,87,0,28,
2020-04-28 12:44:42.612113,281.0699,1,15466775,281.0400,281.0700,18416,O,24,87,0,28,
2020-04-28 12:44:42.244402,281.0500,13,15466774,281.0400,281.0700,48319,O,5,87,0,28,
2020-04-28 12:44:42.244360,281.0500,5,15466761,281.0400,281.0700,48318,O,5,87,0,28,
2020-04-28 12:44:42.093158,281.0400,5,15466756,281.0400,281.0700,7694,O,25,87,0,28,
2020-04-28 12:44:42.061564,281.0700,23,15466751,281.0400,281.0700,41553,O,19,87,0,28,
2020-04-28 12:44:42.035009,281.0401,3,15466728,281.0400,281.0700,18415,O,24,87,0,28,

You can group the ticks by time and by price level and execute a formula on it.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Quote: Thank you for your reply. Comments/questions below:

1. Ok, so 5009 only does trades (is that what you call a tick?)
2. Do I have to subscribe to market depth or is that included?
3. How do I know what comes from the exchange and what from dtn and most importantly what is calculated from iqconnect on my computer.
4. I don't understand "TickIDs don't necessarily increment" if they get incremented for each tick? for a non forex symbol it should increment with each message?
--- Original message by trader2021 on Apr 28, 2020 09:29 AM
1. I've been using the term 'tick' a little broadly here. A more precise phrasing would be "Level 1 data contains all trades and NBBO (national best bid and offer) quotes." We do not bundle trades/NBBO quotes in any way on the live feed.

2. It is additional. Market Depth is one of the many additional data sources (like other exchanges) you can subscribe to via

3. The "origin of data" column at tells you how each data point is determined. If you're asking about individual cases where a data point can came from more than one source ("Provided by the exchange or 3rd party data provider") there's no field that identifies the exact source for each data point.

4. What I mean is, TickIDs don't necessarily increase by 1 every time. They're not necessarily sequential. The only guarantee is that a TickID will be unique for that symbol and that exchange... and even that has a caveat, because of the way the CME sends data (see ). CME sometimes sends records in bulk, but we split them back out into single records, with the same TickID. That is an exception to that rule.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Quote: Couple of questions on:

1. How do I distinguish trade data from level 1 book updates?
2. is the book always provided on a trade update?
3. Is the VWAP for CME calculated in iqconnect.exe or calculated by your server or exchange?
4. What is TickID? Is that a sequence which gets incremented for each quote update? Or is it increment for each trade?
5. If two trades happen at the same price and same time, do you sum them and send them in one message?
6. What about numtrades?

If iqconnects shuts crashes and is not connected for some time, when it reconects will the fields it calculates be correct (in other words) does it fill gaps?
--- Original message by trader2021 on Apr 27, 2020 11:05 PM
1. I'm not sure what you mean by "Level 1 book updates." Level 1 (port 5009 by default) delivers only tick data, nothing related to market depth. All market depth information comes from the Level 2 port, Port 9200.

2. You will receive one message for each current market maker (Nasdaq Level 2 if watching equities) or Level of Market Depth (if watching Futures). Again, this comes from the Level 2 port.

3. It could actually be either. If the exchange does not report it, DTN calculates it. Otherwise DTN sends what the exchange reports.

4. A TickID is a unique numeric identifier for that tick. TickIDs don't necessarily increment; they are only guaranteed to be unique by symbol/traded market. Forex symbols don't have a TickID; the Volume is incremented by 1 with each tick.

5. On the Level 1 port, each tick has its own message.

6. Historical requests have a Number of Trades field where appropriate. For example, if you request historical data in 5-minute intervals, each record will contain a field that tells you how many trades make up that 5-minute interval. This would apply to the HIX, HID, and HIT commands.

7. Not if it's disconnected for a long time. The IQFeed API has some functionality that can bridge short disconnections, but not a long one.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » C Today. Apr 20, 2020 12:22 PM (Total replies: 10)

Unfortunately, there's not really a way for us to know what happened after the fact. However, to help track down the problem, there are a few fields you could add to your request going forward, which will be helpful if it happens again:

One field is called Delay. This tells you if the symbol's data is being delayed, for reasons of not being subscribed to the realtime data. This should always be 0 for your symbols, because you appear to have all the necessary subscriptions. If it isn't, let us know right away.

You can also add the Most Recent Trade time field as well along with the Bid/Ask Time fields. This information will help us determine the exact nature of the delay problem.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » C Today. Apr 16, 2020 03:24 PM (Total replies: 10)

Yes, I would be curious to know what other symbols were affected, to see if there's any pattern to it all.

Gary Stephen
DTN IQFeed Implementation Support Specialist

Edited by DTN_Gary_Stephen on Apr 17, 2020 at 07:01 AM

IQFeed Developer Support » C Today. Apr 16, 2020 08:34 AM (Total replies: 10)


I got a reply from our data team. First, there wasn't any problem with the feed that morning, nor any corrections made to the symbol C. It appears your being data was delayed. The times on your chart appear to be 15 minutes behind what our historical data shows for that morning:

Time Last
9:20:00 $47.98
9:25:00 $47.90
9:30:00 $47.51 (9:45 on your chart)
9:35:00 $46.59 (9:50 on your chart)
9:40:00 $46.27 (9:55 on your chart)
9:45:00 $45.76 (10:00 on your chart)
9:50:00 $45.47
9:55:00 $46.05

The same is true if we look at the Bid and Ask:

Time Bid Ask
9:15:00 $47.43 $47.84 (9:30 on your chart)
9:20:00 $47.62 $47.99 (9:35 on your chart)
9:25:00 $47.71 $47.96 (9:40 on your chart)
9:30:00 $47.50 $47.65 (9:45 on your chart)

It's normal for the Bid/Ask gap to be wider before the market actually opens, because these are all non-regular trades, many of which are for small lots.

So why was this data delayed? First, C is an NYSE symbol. Are you subscribed to live data from the NYSE exchange? If you're not sure, double-click the blue IQConnect logo, and then the "Authorizations" dropdown. "NYSE" will be present if you are. (Keep in mind that if you have more than one IQFeed login, each login can have its own subscriptions.)

If you are subscribed to NYSE, were any other symbols delayed in the same way? There are some known causes data feed can be delayed, but generally they would affect all symbols, not just one. And, the delays wouldn't be quite as regular as this.

Let me know the answers to these two and I can investigate further as needed.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » C Today. Apr 15, 2020 04:18 PM (Total replies: 10)

If I'm reading this correctly: Blue is the ask, Red is the bid, and Green is that last, which only starts appearing at 9:45. And C, Citigroup, is the symbol. That chart does vary significantly from the past data that is visible in Time and Sales, which looks pretty normal. There are ticks before 9:45, and the Bid/Ask vary normally. You retrieved this data as it came in via a watch (wC) command, correct? Did you customize the fields at all with an S,SELECT UPDATE FIELDS command?

I'll ask our data team if there were any corrections made to that symbol's data, or problems that morning.

Gary Stephen
DTN IQFeed Implementation Support Specialist

IQFeed Developer Support » IQFeed on Linux throws ICMP error Apr 15, 2020 03:26 PM (Total replies: 3)

Are you using Wine to run IQConnect.exe? That type of error is usually a Wine error. Let me know, and we may have you turn on some logging, to see what the program is doing behind the scenes.

Gary Stephen
DTN IQFeed API Support

Gary Stephen
DTN IQFeed Implementation Support Specialist

Time: Wed June 3, 2020 12:54 AM CFBB v1.2.0 31 ms.
© AderSoftware 2002-2003