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.
|