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)




"Very impressed with the quality of your feed - ******* is a real donkey in comparison." - Comment from A.C. via Email
"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.
"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
"I would just like to say that IQFeed version 4 is running very well and I am very happy with its performance. I would also like to extend a big thanks for the fast and efficient help that I always receive. My questions and concerns are always addressed promptly. Way to go!" - Comment from Josh in CO.
"There is no doubt that IQFeed is the best data provider. I am very satisfied with your services. And IQFeed is the only one that I would recommend to my friends. Now, most of them are using your product in China." - Comment from Zhezhe
"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
"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
"I am enjoying the feed very much - so superior to the broker provided feed I was previously using." - Comment from George
"I've been using Neoticker RT with IQFeed for two months, and I'm very happy with both of the products (I've had IQFeed for two years with very few complaints). The service from both companies is exceptional." - Comment from Public Forum
"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
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 »[C#] error with Historical Data Request
Author Topic: [C#] error with Historical Data Request (2 messages, Page 1 of 1)

amethyste
-Interested User-
Posts: 15
Joined: Nov 4, 2009


Posted: Nov 4, 2009 10:59 AM          Msg. 1 of 2
Hi,

I'm new with iqfeed.
I want receive historical for MSFT in order to test the API.
When I get realtime data it's OK but with historical data not.

The error message is "unable to connect to Day history socket"

Thanks


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

using DTNHISTORYLOOKUPLib;
using DTNIQFeedCOMLib;
using DTNNEWSLOOKUPLib;
using DTNOPTIONCHAINLOOKUPLib;
using DTNSYMBOLLOOKUPLib;


using IQ_APILib;




namespace MetaFinance
{
class Program
{
private object OnAbortedLoad;

static void Main(string[] args)
{
Program p = new Program();
Console.ReadLine();
}

Program()
{
Console.WriteLine("start");


HistoryLookup m_historyLookup = new HistoryLookup();
m_historyLookup.DayCompleted += new _IHistoryLookupEvents_DayCompletedEventHandler(m_historyLookup_DayCompleted);
m_historyLookup.AbortedLoad += new _IHistoryLookupEvents_AbortedLoadEventHandler(m_historyLookup_AbortedLoad);
m_historyLookup.RequestDayHistory("MSFT", 2);

//LevelOne oLevelOne = new LevelOne();
//oLevelOne.Fire_OnUpdateMsg += new _ILevelOneEvents_Fire_OnUpdateMsgEventHandler(oLevelOne_Fire_OnUpdateMsg);
//oLevelOne.ReqWatch("MSFT");
//oLevelOne.ReqWatch("GOOG");
//oLevelOne.ReqWatch("AAPL");
}

void m_historyLookup_AbortedLoad(string bsReason)
{
Console.WriteLine(bsReason);
}

private void m_historyLookup_DayCompleted(int noDays_, object objTime_, object objOpen_, object objClose_, object objHigh_, object objLow_, object objVolume_)
{
Console.WriteLine("Historical");
}


void oLevelOne_Fire_OnUpdateMsg(ref string pbstrUpdateMessages)
{
Console.WriteLine("RealTime");
}



}
}

DTN_Steve_S
-DTN Guru-
Posts: 2093
Joined: Nov 21, 2005


Posted: Nov 5, 2009 08:40 AM          Msg. 2 of 2
First, I would highly recommend that you use the IHistoryLookup3 interface that is in DTNIQFeedCOM.dll instead of the old deprecated history lookup interfaces in the DTNHistoryLookup.dll. Since the interfaces in DTNHistoryLookup.dll are deprecated, they will most likely stop working in an upcomming version and we will stop distributing them. You might as write your code currently to the current interface rather than having to redo it later.

As for the issue above. Just based on the code you have posted, I would guess that the issue is that you haven't actually launched the feed yet. Take a look at the docs for Initializing the feed and let me know if you have questions.
 

 

Time: Mon May 6, 2024 10:03 PM CFBB v1.2.0 13 ms.
© AderSoftware 2002-2003