[Quantproject-developers] QuantProject/b3_Data/DataTables Quotes.cs,1.8,1.9
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-08-28 17:18:15
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9074/b3_Data/DataTables Modified Files: Quotes.cs Log Message: The constructor has been overloaded, to build a Quotes data table containing a row for each ticker in a given collection, with the quotes for the given DateTime. Preexisting two constructors have been moved to the begin of the file. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Quotes.cs 22 Aug 2004 16:56:25 -0000 1.8 --- Quotes.cs 28 Aug 2004 17:18:06 -0000 1.9 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.Collections; using System.Data; using System.Text; *************** *** 25,28 **** --- 26,64 ---- public static string AdjustedCloseToCloseRatio = "quAdjustedCloseToCloseRatio"; + /// <summary> + /// Builds a Quotes data table containing a row for each ticker in the + /// collection, with the quotes for the given DateTime + /// </summary> + /// <param name="tickerCollection">Tickers whose quotes are to be fetched</param> + /// <param name="dateTime">Date for the quotes to be fetched</param> + public Quotes( ICollection tickerCollection , DateTime dateTime ) + { + QuantProject.DataAccess.Tables.Quotes.SetDataTable( + tickerCollection , dateTime , this ); + } + public Quotes( string ticker , DateTime startDate , DateTime endDate ) + { + this.fillDataTable( ticker , startDate , endDate ); + } + public Quotes( string ticker ) + { + this.fillDataTable( + ticker , + QuantProject.DataAccess.Tables.Quotes.GetStartDate( ticker ) , + QuantProject.DataAccess.Tables.Quotes.GetEndDate( ticker ) ); + } + private void fillDataTable( string ticker , DateTime startDate , DateTime endDate ) + { + QuantProject.DataAccess.Tables.Quotes.SetDataTable( + ticker , startDate , endDate , this ); + this.setPrimaryKeys(); + } + private void setPrimaryKeys() + { + DataColumn[] columnPrimaryKeys = new DataColumn[1]; + columnPrimaryKeys[0] = this.Columns[Quotes.Date]; + this.PrimaryKey = columnPrimaryKeys; + } + /// <summary> /// returns most liquid tickers within the given set of tickers *************** *** 274,302 **** } - private void setPrimaryKeys() - { - DataColumn[] columnPrimaryKeys = new DataColumn[1]; - columnPrimaryKeys[0] = this.Columns[Quotes.Date]; - this.PrimaryKey = columnPrimaryKeys; - } - - - private void fillDataTable( string ticker , DateTime startDate , DateTime endDate ) - { - QuantProject.DataAccess.Tables.Quotes.SetDataTable( - ticker , startDate , endDate , this ); - this.setPrimaryKeys(); - } - public Quotes( string ticker , DateTime startDate , DateTime endDate ) - { - this.fillDataTable( ticker , startDate , endDate ); - } - public Quotes( string ticker ) - { - this.fillDataTable( - ticker , - QuantProject.DataAccess.Tables.Quotes.GetStartDate( ticker ) , - QuantProject.DataAccess.Tables.Quotes.GetEndDate( ticker ) ); - } #region GetHashValue private string getHashValue_getQuoteString_getRowString_getSingleValueString( Object value ) --- 310,313 ---- |