[Quantproject-developers] QuantProject/b2_DataAccess/Tables Quotes.cs,1.18,1.19 Tickers.cs,1.2,1.3
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:09
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b2_DataAccess/Tables Modified Files: Quotes.cs Tickers.cs Log Message: Index: Tickers.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Tickers.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Tickers.cs 25 Apr 2004 17:37:52 -0000 1.2 --- Tickers.cs 1 Dec 2004 22:47:00 -0000 1.3 *************** *** 92,96 **** tickerSymbolIsLike + "' " + "AND tiCompanyName LIKE '" + ! tickerCompanyNameIsLike + "'"; return sqlSelectString; } --- 92,97 ---- tickerSymbolIsLike + "' " + "AND tiCompanyName LIKE '" + ! tickerCompanyNameIsLike + "' " + ! "ORDER BY tiTicker"; return sqlSelectString; } Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/Tables/Quotes.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Quotes.cs 28 Aug 2004 17:13:55 -0000 1.18 --- Quotes.cs 1 Dec 2004 22:47:00 -0000 1.19 *************** *** 316,325 **** public static void ComputeCloseToCloseValues(DataTable tableOfAllQuotesOfAGivenTicker) { ! DataColumn[] columnPrimaryKey = new DataColumn[1]; ! columnPrimaryKey[0]= tableOfAllQuotesOfAGivenTicker.Columns[Quotes.Date]; ! tableOfAllQuotesOfAGivenTicker.PrimaryKey = columnPrimaryKey; int numRows = tableOfAllQuotesOfAGivenTicker.Rows.Count; ! DataView orderedDyDate = new DataView(tableOfAllQuotesOfAGivenTicker, Quotes.AdjustedClose + ">=0", Quotes.Date + " ASC", DataViewRowState.CurrentRows); --- 316,325 ---- public static void ComputeCloseToCloseValues(DataTable tableOfAllQuotesOfAGivenTicker) { ! //DataColumn[] columnPrimaryKey = new DataColumn[1]; ! //columnPrimaryKey[0]= tableOfAllQuotesOfAGivenTicker.Columns[Quotes.Date]; ! //tableOfAllQuotesOfAGivenTicker.PrimaryKey = columnPrimaryKey; int numRows = tableOfAllQuotesOfAGivenTicker.Rows.Count; ! DataView orderedByDate = new DataView(tableOfAllQuotesOfAGivenTicker, Quotes.AdjustedClose + ">=0", Quotes.Date + " ASC", DataViewRowState.CurrentRows); *************** *** 328,335 **** DateTime date; DataRow rowToBeChanged; for(int i = 0;i != numRows;i++) { ! date = (DateTime)orderedDyDate[i].Row[Quotes.Date]; ! rowToBeChanged = tableOfAllQuotesOfAGivenTicker.Rows.Find(date); if(i == 0) //the first available quote ... --- 328,338 ---- DateTime date; DataRow rowToBeChanged; + DataRow[] foundRows; for(int i = 0;i != numRows;i++) { ! date = (DateTime)orderedByDate[i].Row[Quotes.Date]; ! foundRows = tableOfAllQuotesOfAGivenTicker.Select(Quotes.Date + "=" + ! SQLBuilder.GetDateConstant(date)); ! rowToBeChanged = foundRows[0]; if(i == 0) //the first available quote ... *************** *** 342,347 **** { //the other quotes have a previous and a current close ! previousClose = (float)orderedDyDate[i-1].Row[Quotes.AdjustedClose]; ! currentClose = (float)orderedDyDate[i].Row[Quotes.AdjustedClose]; if(previousClose != 0) --- 345,350 ---- { //the other quotes have a previous and a current close ! previousClose = (float)orderedByDate[i-1].Row[Quotes.AdjustedClose]; ! currentClose = (float)orderedByDate[i].Row[Quotes.AdjustedClose]; if(previousClose != 0) |