[Quantproject-developers] QuantProject/b2_DataAccess/Tables Quotes.cs,1.19,1.20
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-01-06 18:44:06
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9731/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: Added method GetNumberOfDaysWithEffectiveTrades (that's it: traded volume > 0) Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Quotes.cs 1 Dec 2004 22:47:00 -0000 1.19 --- Quotes.cs 6 Jan 2005 18:43:57 -0000 1.20 *************** *** 93,96 **** --- 93,111 ---- /// <summary> + /// Returns the number of days at which the given ticker has beeb effectively traded + /// </summary> + /// <param name="ticker">ticker for which the number of days has to be returned</param> + /// <returns></returns> + public static int GetNumberOfDaysWithEffectiveTrades( string ticker, DateTime firstDate, + DateTime lastDate) + { + DataTable dataTable = SqlExecutor.GetDataTable( + "select * from quotes WHERE quTicker='" + ticker + "'" + + " AND " + "quVolume>0" + " AND quDate BETWEEN " + SQLBuilder.GetDateConstant(firstDate) + + " AND " + SQLBuilder.GetDateConstant(lastDate)); + return dataTable.Rows.Count; + } + + /// <summary> /// Returns the adjusted close value for the given ticker at the specified date /// is returned |