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)




"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
"Just a thank you for the very helpful and prompt assistance and services. You provided me with noticeably superior service in my setup compared to a couple of other options I had looked at." - Comment from John
"I like you guys better than *******...much more stable and a whole lot fewer issues." - Comment from Philip
"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
"Just a quick one to say I'm very impressed so far :) The documentation for developers is excellent and I've quickly managed to get an app written to do historical downloads. The system is very robust and pretty quick considering the extent of data that's available. The support guys have been very helpful too, in combination with the forums it's been plain sailing so far!" - Comment from Adam
"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.
"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
"Thank God for your Data Feed as the only Zippers I see are on my pants (LOL), and no more 200 pip spikes to mess up charts." - Comment from Spiro via Email
"I'm very glad I switched to IQFeed. It's working perfectly with no lag, even during fast market conditions." - Comment from Andy via Email
"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 3, 2024 8:03 PM CFBB v1.2.0 11 ms.
© AderSoftware 2002-2003