[Quantproject-developers] QuantProject/b3_Data/DataTables GroupQuotes.cs,1.1,1.2
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-01-06 18:44:07
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9731/b3_Data/DataTables Modified Files: GroupQuotes.cs Log Message: Added method GetNumberOfDaysWithEffectiveTrades (that's it: traded volume > 0) Index: GroupQuotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/GroupQuotes.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GroupQuotes.cs 25 Jul 2004 12:02:39 -0000 1.1 --- GroupQuotes.cs 6 Jan 2005 18:43:57 -0000 1.2 *************** *** 185,188 **** --- 185,200 ---- /// <summary> + /// Returns the number of days at which the given ticker has been effectively traded + /// </summary> + /// <param name="ticker">ticker for which the number of days has to be returned</param> + /// <returns></returns> + public int GetNumberOfDaysWithEffectiveTrades( string ticker ) + { + DataRow[] rows = this.Select(Quotes.TickerFieldName + "='" + ticker + "'" + + " AND " + Quotes.Volume + ">0"); + return rows.Length; + } + + /// <summary> /// If the given ticker has a quote at the given date, then it returns the given date, /// else it returns the first valid following date at which a quote is available |