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 either overstaffed or people just don't have problems with your feed because customer support always answers the phone quickly." - Comment from Jay via Email
"Version 4.0.0.2 has been working well for me and I appreciate that it is now a much tighter client to work with. I feel I can go to press with my own application and rely on a stable platform" - Comment from David in IA.
"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 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 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
"DTN has never given me problems. It is incredibly stable. In fact I've occasionally lost the data feed from Interactive Brokers, but still been able to trade because I'm getting good data from DTN." - Comment from Leighton
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"You have an excellent feed. Very few spikes for Spot Forex." - Comment from Public Forum Post
"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
"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
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: Sun May 19, 2024 8:38 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003