[Quantproject-developers] QuantProject/b2_DataAccess/Tables Quotes.cs,1.12,1.13
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-06-27 19:16:24
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20236/b2_DataAccess/Tables Modified Files: Quotes.cs Log Message: Fixed minor bug Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Quotes.cs 25 Jun 2004 14:12:23 -0000 1.12 --- Quotes.cs 27 Jun 2004 19:16:15 -0000 1.13 *************** *** 90,94 **** return dataTable.Rows.Count; } ! /// <summary> /// It provides updating the database for each closeToCloseRatio contained in the given table --- 90,107 ---- return dataTable.Rows.Count; } ! ! /// <summary> ! /// Returns the adjusted close value for the given ticker at the specified date ! /// </summary> ! /// <param name="ticker">ticker for which the adj close has to be returned</param> ! /// <returns></returns> ! public static float GetAdjustedClose( string ticker, DateTime date ) ! { ! DataTable dataTable = SqlExecutor.GetDataTable( ! "select quAdjustedClose from quotes where quTicker='" + ticker + "' " + ! "and quDate=" + SQLBuilder.GetDateConstant(date) ); ! return (float)dataTable.Rows[0][0]; ! } ! /// <summary> /// It provides updating the database for each closeToCloseRatio contained in the given table *************** *** 234,239 **** int numRows = tableDB.Rows.Count; DateTime date; ! double adjCTCInDatabase; ! double adjCTCInSource; double absoluteDifference; DataRow rowToCheck; --- 247,252 ---- int numRows = tableDB.Rows.Count; DateTime date; ! float adjCTCInDatabase; ! float adjCTCInSource; double absoluteDifference; DataRow rowToCheck; *************** *** 241,249 **** { date = (DateTime)tableDB.Rows[i][Quotes.Date]; ! adjCTCInDatabase = (double)tableDB.Rows[i][Quotes.AdjustedCloseToCloseRatio]; rowToCheck = tableSource.Rows.Find(date); if(rowToCheck != null) { ! adjCTCInSource = (double)rowToCheck[Quotes.AdjustedCloseToCloseRatio]; absoluteDifference = Math.Abs(adjCTCInDatabase - adjCTCInSource); if(absoluteDifference > ConstantsProvider.MaxDifferenceForCloseToCloseRatios ) --- 254,262 ---- { date = (DateTime)tableDB.Rows[i][Quotes.Date]; ! adjCTCInDatabase = (float)tableDB.Rows[i][Quotes.AdjustedCloseToCloseRatio]; rowToCheck = tableSource.Rows.Find(date); if(rowToCheck != null) { ! adjCTCInSource = (float)rowToCheck[Quotes.AdjustedCloseToCloseRatio]; absoluteDifference = Math.Abs(adjCTCInDatabase - adjCTCInSource); if(absoluteDifference > ConstantsProvider.MaxDifferenceForCloseToCloseRatios ) |