I don't know how the QP2 database lets the user know there is no data
for a given date. Instead I suggest an alternate method for handling
this problem. You could use a test similar to the following.
If (dayRequested + DaysLoaded) < 1 Then don't get price data
Else
Get price data
End If
Where dayRequested is less than or equal to 0 and is the day for which
you want to retrieve data and DaysLoaded is the number of days of data a
particular stock has in the QP database.
I also noticed that the COM returns an exception if you try to get the
DaysLoaded value for an invalid symbol. Hence a block of code similar
to the following lets you handle invalid symbols.
Try
Dim NumOfDaysOfData As Integer = qpData.DaysLoaded
Catch ex As Exception
' Put your code for handling the exception here.
End Try
I stumbled on these methods while try to modify Example 1 in the VB60
directory in the QpDevKit22 for use with Visual Basic 2005 Express
Edition. There is an example of their use in the EX1forVB2005 file
uploaded to this message group's files section.
Howard
A day late and a dollar short
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of nduroman
Sent: Tuesday, November 01, 2005 9:55 AM
To: [email protected]
Subject: [quotes-plus] How does QP2 database identify when there is no
data for a symbol?
Hi,
I was wondering if anyone could confirm how the QP2 database lets
the user know that there was no data for a given number of days back.
For example suppose we go 700 days back on GOOG and assume it was
not trading at the time. What does close(-700) return?
I have used/am using the COM interop with Visual C++.Net 2005 and
VB.Net 2003.
It appears to me that if I have a Price2Class myPrices I would get
the following for GOOG:
C++: Debug::WriteLine(Convert::ToString(myPrices->Close(-700)))
prints out "1240920". I also got this for other IPOs when there was
no data.
However, when I used VB.Net earlier in the year it seems to me that
Debug.WriteLine(myPrices.Close(-700)) would give me -700.
Any help would be appreciated.
Sincerely,
John
I have posted some sample code in Visual C++.Net 2005 below:
******************************************************
QuotesPlus::SymbolsClass ^mySymbols = gcnew QuotesPlus::SymbolsClass;
mySymbols->LISTBY = QuotesPlus::LISTBY::QPLB_STOCKS;
mySymbols->SORTORDER = QuotesPlus::SORTORDER::QPSO_ASCEND;
QuotesPlus::Price2Class ^myPrices = gcnew QuotesPlus::Price2Class;
QuotesPlus::CompanyInfoClass ^myInfo gcnew
QuotesPlus::CompanyInfoClass;
String ^str_LastSymbol;
double dbl_IssueTypeCode;
mySymbols->Last(); // comment out for testing;
str_LastSymbol = mySymbols->Symbol;
mySymbols->First();
while(String::Equals(mySymbols->Symbol,str_LastSymbol)==false)
{
myInfo->Symbol = mySymbols->Symbol;
myPrices->Symbol = mySymbols->Symbol;
dbl_IssueTypeCode =
Convert::ToDouble(myInfo->IssueType_Code());
/********************************************************************
**
If there is no data program returns 1240920
*************************************************************
***********/
if((dbl_IssueTypeCode == 48) &&
(mySymbols->Symbol == "AATI "))
{
int int_Count;
for(int_Count = 0; int_Count > -800;int_Count--)
{
Debug::WriteLine
(Convert::ToString(myPrices->Close(int_Count)));
}
}
mySymbols->Next();
}
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/quotes-plus/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/quotes-plus/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/