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)




"Everything is working great with the API. I love it." - Comment from Calvin
"Previously I was using *******. IQFeed is WAY more economical, and for my charting needs is just as good, if not better." - Comment from Public Forum Post
"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
"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
"Everything is working amazing now. I'm already impressed with the true-tick feed of IQFeed and it's ability to support my 480 symbol layout." - Comment from Tyler via Email
"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
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"Interactive Brokers tick data was inconsistent, so I have switched to using DTN exclusively. It is great to no longer have to worry about my datafeed all day long." - Comment from Philippe
"I cannot believe what a difference it makes trading with ProphetX!" - Comment from Bruce in Los Angeles
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
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: Jul 25, 2022 08:13 AM
Last Visit: Jul 28, 2022 09:48 AM
Website:  
Location:
Occupation:
Interests:
Avatar:
Email: gary.stephen@dtn.com
AIM:
ICQ:
MSN IM:
Yahoo IM:
Post Statistics
DTN_Gary_Stephen has contributed to 267 posts out of 20658 total posts (1.29%) in 1,139 days (0.23 posts per day).

20 Most recent posts:
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. http://www.iqfeed.net/dev/api/docs//Derivatives_StreamingIntervalBars_TCPIP.cfm 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 http://www.iqfeed.net/dev/api/docs/Level1UpdateSummaryMessage.cfm. You can view the one(s) you need.

I hope this is all helpful!

Sincerely,
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.

Sincerely,
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.

Sincerely,
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.

Sincerely,
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:

FDS,1,5,20220128
LM,Symbol,Description,PeRatio,AvgVolume,DivYield,DivAmount,DivRate,PayDate,ExDivDate,CurrentEps,EstEps,SIC,Precision,Display,GrowthPercent,FiscalYearEnd,Volatility,ListedMarket,MaturityDate,OptionRoots,CouponRate,InstitutionalPercent,YearEndClose,Beta,LEAPs,WRAPs,Assets,Liabilities,BalanceSheetDate,LongTermDebt,CommonSharesOutstanding,MarketCap,52WeekHigh,52WeekHighDate,52WeekLow,52WeekLowDate,CalHigh,CalHighDate,CalLow,CalLowDate,Expiration,LastSplit,LastSplitDate,PrevSplit,PrevSplitDate,NAICS,ShortInterest
LM,AAPL,"APPLE",28.1,98835,0.55,0.22,0.88,20211111,20211105,5.67,,3571,4,14,0.22,20210901,24.93,21,,"AAPL",,36.905,177.57,1.24,,,134836,125481,20210930,109106,16334371,2600759,182.94,20220104,116.21,20210308,182.94,20220104,154.7,20220124,,0.25,20200831,0.14,20140609,334220,

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

Sincerely,
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!

ChainsawDR
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,
!ENDMSG!,

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."

Sincerely,
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.

Sincerely,
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 http://www.iqfeed.net/dev/upgrade.cfm?protocol=2 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.

Sincerely,
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.


Sincerely,
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"
sock.sendall(message.encode())

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.

Sincerely,
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.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist



Mark,

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:

CEO,AAPL,pc,,2,2,10,10,,1

Sincerely,
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:

Symbol,Exchange,Type,Last,TradeSize,TradedMarket,TradeDate,TradeTime,Open,High,Low,Close,Bid,BidMarket,BidSize,Ask,AskMarket,AskSize,Volume,PDayVolume,UpVolume,DownVolume,NeutralVolume,TradeCount,UpTrades,DownTrades,NeutralTrades,VWAP,MutualDiv,SevenDayYield,OpenInterest,Settlement,SettlementDate,ExpirationDate,Strike

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.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist



Mark,

That command works successfully for me:

CEO,AAPL,pc,,2,2,10,10,MWR,1

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!

Sincerely,
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.

Sincerely,
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.

Sincerely,
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.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist


IQFeed Developer Support » Bad Ticks In GME Tick History. May 19, 2022 05:44 PM (Total replies: 3)

I have some further information: GME experienced very volatile trading on May 12. The stock was halted 4 times during that day due to limit up/limit down restrictions. The trade you're asking about was the last trade before the first halt occurred. The bid/ask at the time of the trade, are not truly reflective of this trade. Trading resumed again 5 minutes later.

So this trade isn't exactly what I speculated, it was a unique situation. But the situation I described is common, especially in bid/ask offers that aren't also trades.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist


IQFeed Developer Support » Bad Ticks In GME Tick History. May 19, 2022 02:20 PM (Total replies: 3)

When a tick error occurs, the exchanges will send a Trade Correction, and the history available via historical API lookup will be updated to reflect the correction. As of today, that tick is still in the history, so it's probably not an error.

What is it, then? The Ask Price of 500,000 is probably something I call a "token bid." Sometimes the market makers want to have an active Bid or Ask for a symbol, but don't actually want to buy or sell any of that symbol. So they set a ridiculously high ask, or a ridiculously low bid, that no one will ever try to execute. So this is probably a legit transaction. I'm not sure how this bid/ask could have resulted in a sale, but it is normal for outlandish bid/ask prices to show up on the Level 1 feed as just bid/ask offers.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist


IQFeed Developer Support » How to find Future Contract May 12, 2022 01:08 PM (Total replies: 6)

NFX effectively eased operations as a futures exchange on June 2, 2020: seehttps://www.nasdaq.com/solutions/nasdaq-futures-nfx

So there are no more active symbols for that exchange. It should not have been a choice in the account management portal; we are working to remove it as a choice now.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist



Time: Sun August 14, 2022 8:08 AM CFBB v1.2.0 47 ms.
© AderSoftware 2002-2003