John: I have downloaded your file and was able to run in VB 2005 Express Edition. Had to change one line to include as Double. I also added a Description line to include company name. Have to change this to a Windows application from the console.
Thanks for the assist. Dale -- Dale M Warehime 3290 Charmil Drive Manchester, MD 21102 410-239-7343 ---- nduroman <[EMAIL PROTECTED]> wrote: > Hi all, > > I don't use VB.Net anymore but figured more people would be > comfortable in VB.Net than C++.Net. Look for a file from "nduroman" > QP_Ex_Closes. I will paste the code in here as well. Everything is > commented out. Again if you are serious I recommend Van Vliet and > Hendry's "Modeling Financial Markets". It takes you through objects > and classes, databases and ADO.Net, collection classes in .Net, etc. > I have found NO better source. And it is written in VB which many of > you would like. My example gives instructions on how to add a > reference. The program simply filters the QP database for common > stocks closing above $10 one trading day back. It would be helpful > if QP added a Count property to the Symbols class because then we > would not have the issue of not being able to read the last symbol > in the iteration (iteration for my purposes means stepping through > the symbols). > > Sincerely, > > John > > HERE IS THE CODE WITH COMMENTS. Recall in VB a "'" proceeds a > comment. Comments are not part of the code. # is an abbreviation for > a "double", $ is an abbreviation for a String > > '******************************************* > 'IN VB.NET 2003 > > '1. Open a CLR Console Application in Visual Studio VB 2003. > Choose "File" , "New", "Project" , ".NET", "Console Application". > You will probably later use a Windows Form Application to create a > GUI (Graphical User Interface) but the principles are the same. > '2. Go to "Project" in the menu > '3. Choose "Add Reference" > '4. Click on the COM tab and find "Quotes Plus 1.1 Type Library. > Highlight this and press "Select" then OK. > > 'Until you follow the steps above the code below will not > compile!!!!!! > > Imports QuotesPlus > > > Module Module1 > > Sub Main() > > Dim mySymbols As New QuotesPlus.SymbolsClass 'create an > instance of the Symbols class > > mySymbols.LISTBY = LISTBY.QPLB_STOCKS 'we want to list only > stocks > > mySymbols.SORTORDER = SORTORDER.QPSO_ASCEND 'we want to sort > in A-Z order > > Dim myPrices As New QuotesPlus.Price2Class 'create an > instance of the Price2 class > > Dim myCompanyInfo As New QuotesPlus.CompanyInfoClass 'create > an instance of the CompanyInfo class > > mySymbols.Last() 'set the interator at the last symbol in > the list > Dim str_LastSymbol$ = mySymbols.Symbol 'set the string > variable to the value of the last symbol > > mySymbols.First() 'set the iterator at the first symbol in > the list > > Dim str_CurrentSymbol$ = mySymbols.Symbol 'set the string > variable to the value of the first symbol > > > 'This while loop goes through all symbols but the last one > in the list. There is no Count method > 'in the QP database so we miss the last symbol unless we run > all our methods specifically on it > 'as well. I choose to live with missing the last symbol. > > While (Not (str_LastSymbol = str_CurrentSymbol)) > > myPrices.Symbol = mySymbols.Symbol 'you must link the > instance of the Price2 class > 'to the Symbols class by Symbol > > myCompanyInfo.Symbol = mySymbols.Symbol 'you must link > the of the CompanyInfo class > 'to the Symbols class by Symbol > > Dim dbl_IssueStatusCode# = > myCompanyInfo.IssueStatus_Code ' I am creating a double variable > 'so that I can further filter on common stocks (Issue > Status Code in database is 48) > > Dim dbl_CloseBack1 = myPrices.Close(-1) 'Get closing > price 1 day back (use negatives); > 'Close(0) is the most recent close > > 'if common stock and close > 10 then write to console > If ((dbl_IssueStatusCode = 48) And (dbl_CloseBack1 > > 10)) Then > > Console.WriteLine(str_CurrentSymbol & vbTab & > dbl_CloseBack1) > 'print out symbol and closing price 1 back to console > > End If > > mySymbols.Next() 'set iterator to next symbol > > str_CurrentSymbol = mySymbols.Symbol() 'set current > symbol to next symbol > > End While > > End Sub > > End Module > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Get to your groups with one click. Know instantly when new email arrives http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/GHeqlB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/quotes-plus/ <*> 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/
