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)




"The service is great, I see a noticeable improvement in my volume profiles over [broker]'s data feed" - Comment from Larry
"It’s so nice to be working with real professionals!" - Comment from Len
"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
"IQFeed version 4 is a real screamer compared to anything else I have seen." - Comment from Tom
"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
"Its working FABULOUSLY for me!! Holy cow...there has been so much I've been missing lately, and with this feed and Linnsoft software...I'm in the game now." - Comment from Chris R.
"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 was on the phone with a friend who uses CQG and right after the Fed announcement, CQG was as much as 30 seconds behind DTN.IQ. Some quotes were off by as much as 15-18 cents. Your feed never missed a beat." - Comment from Roger
"Awesome response, as usual. It is a sincere and refreshing pleasure to do business with DTN, compared to your competition." - Comment from Ryan
"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 »Archive (2017 and earlier) »IQFeed Developer Support »Not getting historical Tick data
Author Topic: Not getting historical Tick data (3 messages, Page 1 of 1)

tester1
-Interested User-
Posts: 2
Joined: Mar 28, 2018


Posted: Apr 3, 2018 12:29 PM          Msg. 1 of 3
Hi I am new to IQfeed and DTN. I am using the Developer license. I am generally interested getting historical data for testing purposes. I am using Python on Windows 8.1. I found a small script on the forum that I adapted to download 1 min data and it works just fine. I have just downloaded a stocks in the S&P500. However I am struggling with tick data downloads. I have tried HTT and HTX but no joy at all.

I have failed to get anything from the example scripts as well.

The edited script that I am using is below. I would appreciate any guidance on this as well as anything relate to python that I need or I may be missing. For Python 2.7 I am using Anaconda (64 bit)

*************************************************************************

import sys
import socket
import string

startdate= '20180101 093000'
enddate = '20180326 160000'

def readHisSock(sock, recv_buffer = 4096):
buffer = ""
data = ""
while 1:
data = sock.recv(recv_buffer)
buffer += data
if "!ENDMSG!" in buffer: break
return buffer[:-12] #removes endmsg line

host = "127.0.0.1" #localhost
syms = ['GE', 'AAPL']
dir = "C:\Users\My Documents\LiClipse Workspace\IQfeed_data_download"

port = 9100 #history socket

for sym in syms:
f = open(sym + ".csv", "w")
message = "HTT," + sym + "20180101 093000, 20180326 160000,,093000,160000,,,,1\n"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
s.sendall(message)
d = readHisSock(s) #d is a string
s.close

d = "".join(d.split("\r")) #server sends multiple endlines
d = d.replace(",\n","\n")[:-1] #server has comma delimiter at end of each record

f.write(d)
f.close()



Edited by tester1 on Apr 3, 2018 at 12:29 PM

DTN_Tim Walter
-DTN Guru-
Posts: 1238
Joined: Apr 25, 2006


Posted: Apr 3, 2018 03:02 PM          Msg. 2 of 3
Hello,

I sent you an email with some issues I noticed on the request itself that you can look at. Enabling logging in the diagnostics app and comparing what you think you are sending to what we are actually receiving would be a good way to catch some of these.

This page defines the HTT request and its results.

http://www.iqfeed.net/dev/api/docs/HistoricalviaTCPIP.cfm

Let us know if the issues persist.

Tim

tester1
-Interested User-
Posts: 2
Joined: Mar 28, 2018


Posted: Apr 4, 2018 06:58 PM          Msg. 3 of 3
Thanks I will check it out.
 

 

Time: Tue April 23, 2024 8:00 AM CFBB v1.2.0 8 ms.
© AderSoftware 2002-2003