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 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
"DTN feed was the only feed that consistently matched Bloomberg feed for BID/ASK data verification work these past years......DTN feed is a must for my supply & demand based trading using Cumulative Delta" - Comment from Public Forum Post
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"With HUGE volume on AAPL and RIMM for 2 days, everyone in a trading room was whining about freezes, crashes and lag with *******, RealTick, TS and Cyber. InvestorRT with IQFeed was rock solid. I mean SOLID!" - Comment from Public IRC Chat
"I cannot believe what a difference it makes trading with ProphetX!" - Comment from Bruce in Los Angeles
"Can I get another account from you? I am tired of ******* going down so often" - Comment from George
"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
"I just wanted to say how happy I am with your service. I was able to download the API docs last week and I was able to replicate Interactive Brokers historical bar queries and realtime bar queries over the weekend. That was about one of the fastest integrations that I've ever done and it works perfectly!!!!" - Comment from Jason via Email
"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
"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
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 »Archive (2017 and earlier) »IQFeed Developer Support »Building Bars from Tick Data
Author Topic: Building Bars from Tick Data (2 messages, Page 1 of 1)

sappjason
-Interested User-
Posts: 8
Joined: Nov 5, 2009


Posted: Nov 6, 2009 06:53 AM          Msg. 1 of 2
Hello,
I'm new to IQFeed and am developing in Java. My short term goal with IQFeed is to implement 5 second OHLC bars (with VWAP for each 5 second bar). So, to do this, it looks like I must request tick data and build the bars myself. I was able to do all of this last night with historical data. So, kudos to you guys for making such an easy to use API. I'm very pleased.
The question I have is how to build my 5 second bars in real time. So, in a perfect world, this is fairly straightforward. Just sit and watch tick data and build my 5 second bars. But, my question is, when do I know that a bar is finished? In other words, on some more illiquid issues, I may not even receive tick data every 5 seconds. So, how to I know when to disseminate a new 5 second bar? My 2nd question has to do with lag. When (for whatever reason), my data feed is lagging, how do I handle that situation? The reason I ask this second question is because I was contemplating issuing a "T<CR><LF>" command every second and when the time changes to the next 5 second interval, I would spit out my previous 5 second bar. But that's problematic if there is lag in receiving tick data.
Any pointers would be greatly appreciated.

Thanks,

Jason Sapp

stargrazer
-DTN Guru-
Posts: 302
Joined: Jun 13, 2005

Right Here & Now


Posted: Nov 6, 2009 07:13 AM          Msg. 2 of 2
You might want to look at a recent thread for a shadow of an idea: http://forums.dtn.com/index.cfm?page=topic&topicID=2556. Sync your computer to NTP. Get 1 second events from the API of your choice. Use the periodic event to close out bars and do other related house-keeping. On illiquid instruments, you may even end up having no bars for certain time periods.
 

 

Time: Thu May 2, 2024 8:19 PM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003