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 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
"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
"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
"Can I get another account from you? I am tired of ******* going down so often" - Comment from George
"Thanks for the great product and support. During this week of high volume trading, my QuoteTracker + IQ Feed setup never missed a beat. Also, thanks for your swiftness in responding to data issues. I was on ******* for a few years before I made the switch over early this year, and wish I had done it a long time ago." - Comment from Ken
"I had always used ******* but for the past 2 weeks have been trying DTN IQFeed. Customer support has been extraordinary. They call just to make sure your problem hasn't recurred." - Comment from Public Forum
"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
"I use IQ Feed, Great stuff as far as data analysis information, storage and retrieval is concerned." - Comment from Public Forum
"Thanks for following up with me. You guys do a great job in tech support." - Comment from Phelps
"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
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 »best way to get correct number of non-time-bars?
Author Topic: best way to get correct number of non-time-bars? (5 messages, Page 1 of 1)

ppsupport
-Interested User-
Posts: 15
Joined: Jun 28, 2013


Posted: Jul 18, 2013 02:03 PM          Msg. 1 of 5
when using historical lookup, how would I best acheive the following?

if I have a strategy that uses say 10k tick (or volume) bars, and it needs 50 of these bars to bootstrap itself.... how would I request this number of bars relative to an arbitrary date (eg if I'm booting in a simulation that runs from last year).

the only way i can think is to request 50 bars back from today, and look at the date of the oldest bar and start counting all older bars (and requesting more) until I get 50. this is really inefficient though. i could leave it up to the user, but that's error prone.

is there a better way w/iqfeed?

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Jul 18, 2013 02:19 PM          Msg. 2 of 5
Take a look at the History Interval Timeframe request from the feed. You can specify a Begin Time, End Time, and interval (in either seconds, ticks, or volume).

Leave the begin date/time blank and supply your initial date as the end date with the number of bars as the max datapoints parameter. This will give you the number of bars you specified immediately prior to the date/time you specify in the end date.

The only issue you may run into here is that our tick/volume/second bars have the same limitation as tick data which means that you can currently only get the last 120 days. You can use time based interval bars (in multiples of 1min) back several years.

ppsupport
-Interested User-
Posts: 15
Joined: Jun 28, 2013


Posted: Jul 18, 2013 02:32 PM          Msg. 3 of 5
i think maybe you're mixing up two requests, because history interval timeframe doesn't support max datapoints.

// HIT,SYMBOL,INTERVAL,BEGINDATE BEGINTIME,ENDDATE ENDTIME,,BEGINFILTERTIME,ENDFILTERTIME,DIRECTION,REQUESTID,DATAPOINTSPERSEND,INTERVALTYPE<CR><LF>

that's sort of the reason for my question because the requests that support maxdatapoints don't support start and end times, and vice verca. be nice to see this in a future version (supporting reference dates on 'maxdatapoint' allowing commands)

at least for volume bars i could request 1min time bars using the dates and reconstruct the volume.

but to reconstruct tick bars i'd have to get ticks, which is limiting as you point out. (i guess you're doing something similiar internally if they all have the same limit)

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Jul 18, 2013 02:36 PM          Msg. 4 of 5
The empty parameter between ENDDATE ENDTIME and BEGINFILTERTIME is the Max datapoint parameter. The parameter was initially included in the protocol but then removed and later re-added so there are probably a few places where the documentation I still incorrect. I have gone through the docs (and example apps) trying to eliminate this inconsistency in the next version of IQFeed (5.1). If you want to let me know where you copied/pasted that from, I'll doublecheck it.

ppsupport
-Interested User-
Posts: 15
Joined: Jun 28, 2013


Posted: Jul 18, 2013 03:00 PM          Msg. 5 of 5
ah, well that's great to hear.

i got it from your c# example for histsockets.

i see that the main documentation now reflects what you saying, thanks again.
 

 

Time: Thu May 23, 2024 9:39 AM CFBB v1.2.0 17 ms.
© AderSoftware 2002-2003