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)




"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
"Thank you so much - awesome feed, awesome service!" - Comment from Greg via Email
"You have an excellent feed. Very few spikes for Spot Forex." - Comment from Public Forum Post
"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
"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
"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
"IQ feed works very well, does not have all of the normal interruptions I have grown used to on *******" - Comment from Mark
"Just a thank you for the very helpful and prompt assistance and services. You provided me with noticeably superior service in my setup compared to a couple of other options I had looked at." - Comment from John
"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
"Everything is working great with the API. I love it." - Comment from Calvin
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 »How to create bar from tick data
Author Topic: How to create bar from tick data (6 messages, Page 1 of 1)

xvz
-Interested User-
Posts: 13
Joined: Mar 28, 2022


Posted: Jul 25, 2022 02:53 AM          Msg. 1 of 6
Hi,

I'm trying to create 1 minute bar from tick data.
I take tick data with "wAAPL" request.

My logic:
1min bar OPEN - I'll take from field Open, from the first tick at current minute
1min bar HIGH - I'll take from field High , from the tick with Max value at current minute
1min bar LOW - I'll take from field Low, from the tick with Min value at current minute
1min bar CLOSE - I'll take from field Close, from the last tick at current minute
1min bar VOLUME - I'll take from field Last Size, I just sum values from all ticks at current minute

Am I doing write? Maybe you can give me some advices? Or there any thing to optimize in my logic ?

And another question:
Why I can't get tick data on premarket session?
Edited by xvz on Jul 25, 2022 at 03:06 AM

DTN_Gary_Stephen
-DTN Guru-
Posts: 288
Joined: Jul 3, 2019


Posted: Jul 25, 2022 08:13 AM          Msg. 2 of 6
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

xvz
-Interested User-
Posts: 13
Joined: Mar 28, 2022


Posted: Jul 25, 2022 09:23 AM          Msg. 3 of 6
Quote: 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.


Thank a lot!!
This is like bomb for me!
I read all documentation , and from the naming I thought that is only for futures and others.
But now I khow, that I can use it for stocks , and it's really good new!

N4Apound
-Interested User-
Posts: 4
Joined: Jun 18, 2012


Posted: Dec 4, 2022 10:02 AM          Msg. 4 of 6
I am also trying to build interval bars from tick data.
My builds NEARLY match iqfeed interval bars, however there is a mismatch when ticks occur whose time label is on the exact interval boundary end time.

I observe (and expect) that iqfeed intervals are INCLUSIVE of the exact interval start time and I expect NON-inclusive of the interval end time. Both cannot be inclusive because resulting interval bars would overlap.

So an iqfeed 1minute interval bar labeled "09:31:00" should include all ticks from 09:30:00.000000 up through 09:30:59.999999.

But there seems to be a problem that if a tick happens to occur at 09:31:00.000000, it is included also in the iqfeed interval bar labeled "09:31:00". But that tick should instead belong only to the "09:32:00" interval, right?

DTN_Gary_Stephen
-DTN Guru-
Posts: 288
Joined: Jul 3, 2019


Posted: Dec 5, 2022 07:13 AM          Msg. 5 of 6
No, that is correct. Any tick with a timestamp between 9:30:00.000000 and 9:30:00.999999 will be part of the "9:30:00" or "9:30:01" bar.

One other thing I should have mentioned in my prior post: that you can specify whether the label represents the beginning or the end of the time period. It defaults to the end, so "10:40:00" represents 10:39:59 to 10:40:00. If you set LabelAtBeginning to 1 in your HIT/HID/HIX historical request (see http://www.iqfeed.net/dev/api/docs/HistoricalviaTCPIP.cfm) then "10:40:00" will represent 10:40:00 to 10:40:01. This choice does not affect the underlying data in any way, just how it is labeled. A second will consist of ticks with timestamps between .000000 and .999999.

Sincerely,
Gary Stephen
DTN IQFeed Implementation Support Specialist

N4Apound
-Interested User-
Posts: 4
Joined: Jun 18, 2012


Posted: Dec 5, 2022 08:08 AM          Msg. 6 of 6
Thanks Gary.
 

 

Time: Sun February 5, 2023 11:33 AM CFBB v1.2.0 31 ms.
© AderSoftware 2002-2003