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)




"Everything is working great with the API. I love it." - Comment from Calvin
"I've never had DTN go out on me since switching. ******* would go down a couple times every month when I was using them." - Comment from Bryce in AL.
"If someone needs the best quality data and backfill beyond what their broker provides at a rate that is the best in the industry, I highly recommend IQFeed." - Comment from Josh via 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
"Excellent datafeed !!!" - Comment from Arely
"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"I noticed that ******* quotes locked up shortly after the interest rate announcement yesterday while yours stayed stable." - Comment from Ron in Utah
"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
"After all the anxiety I had with my previous data provider it is a relief not to have to worry about data speed and integrity." - Comment from Eamonn
"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
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 »A complete example to get historical data using TCP/IP
Author Topic: A complete example to get historical data using TCP/IP (3 messages, Page 1 of 1)

gautham
-Interested User-
Posts: 6
Joined: Sep 22, 2004


Posted: Nov 9, 2004 10:45 AM          Msg. 1 of 3
I am having problem downloading historical data using TCP/IP in Visual C++.
I do not see any example of this in the sample files I got from IQFEED.
I need a complete but simple example showing me how exactly to go about doing this
in a console application.

DTN_Natalie_H
-DTN Evangelist-
Posts: 175
Joined: May 10, 2004

DTN Market Access, LLC.


Posted: Nov 9, 2004 02:28 PM          Msg. 2 of 3
You're correct, we currently do not have a C++ example app for getting history data via sockets. For now you could look at the VB app, or maybe another developer has something they could give you. We are working to build a more comphrehensive suite of example apps. Thanks for your patience!

Natalie Hannan DTN Market Access, LLC.

gautham
-Interested User-
Posts: 6
Joined: Sep 22, 2004


Posted: Nov 9, 2004 04:12 PM          Msg. 3 of 3
I found out that it is pretty simple. I was not able to get historical data before because after using registerclientapp function I was using the statement
SOCKET iqSocket;
struct sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons( 9100 );
addr.sin_addr.S_un.S_addr = inet_addr("127.0.0.1");
memset(&addr.sin_zero, 0, sizeof(addr.sin_zero));

connect( iqSocket(struct sockaddr*)&addr,sizeof(addr))
// connect to the server
send( iqSocket,"S,KEY\r\n", 7, 0); // Should NOT be using this statement.

and then doing
char iqCommand[ 15 ];
memset( iqCommand, 0, sizeof( iqCommand ) );
strcpy( iqCommand, "HD,IBM,5;" );

send( iqSocket, iqCommand, static_cast<int>( strlen( iqCommand ) ), 0 );
The statement
send( iqSocket,"S,KEY\r\n", 7, 0);
seems to have somehow not get the historical data. After removing this statement I do get historical data.
 

 

Time: Fri May 17, 2024 4:04 AM CFBB v1.2.0 10 ms.
© AderSoftware 2002-2003