[Quantproject-developers] QuantProject/b2_DataAccess/Tables Quotes.cs, 1.35, 1.36
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2009-01-01 13:42:42
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13081/Tables Modified Files: Quotes.cs Log Message: Fixed minor bug in static method GetOpenToCloseStandardDeviation: now the method returns a double.Nan when the standardDeviation cannot be computed (so the caller can manage this value). Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Quotes.cs 30 Dec 2008 00:14:16 -0000 1.35 --- Quotes.cs 1 Jan 2009 13:42:36 -0000 1.36 *************** *** 813,816 **** --- 813,817 ---- { DataTable dt; + double returnValue; string sql = "SELECT quotes.quTicker, " + SQLBuilder.GetStandardDeviationFunctionName() + *************** *** 822,826 **** " GROUP BY quotes.quTicker"; dt = SqlExecutor.GetDataTable( sql ); ! return (double)dt.Rows[0]["OpenToCloseStandDev"]; } --- 823,831 ---- " GROUP BY quotes.quTicker"; dt = SqlExecutor.GetDataTable( sql ); ! if( dt.Rows[0]["OpenToCloseStandDev"] is System.DBNull ) ! returnValue = double.NaN; ! else ! returnValue = (double)dt.Rows[0]["OpenToCloseStandDev"]; ! return returnValue; } |