[Quantproject-developers] QuantProject/b3_Data/DataTables Quotes.cs, 1.25, 1.26
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-06-29 17:53:36
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv21376/b3_Data/DataTables Modified Files: Quotes.cs Log Message: - the GetMarketDays static method has been added Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Quotes.cs 14 May 2006 18:28:24 -0000 1.25 --- Quotes.cs 29 Jun 2006 17:53:33 -0000 1.26 *************** *** 658,661 **** --- 658,682 ---- } + /// <summary> + /// returns dates when the ticker was exchanged, within a given + /// date interval + /// </summary> + /// <param name="ticker"></param> + /// <param name="firstDate">begin interval</param> + /// <param name="lastDate">end interval</param> + /// <returns></returns> + public static DateTime[] GetMarketDays( string ticker , + DateTime firstDate , DateTime lastDate ) + { + Quotes quotes = new Quotes( ticker , firstDate , lastDate ); + DateTime[] marketDays = new DateTime[ quotes.Rows.Count ]; + int i = 0; + foreach ( DataRow dataRow in quotes.Rows ) + { + marketDays[ i ] = (DateTime)dataRow[ Quotes.Date ]; + i++; + } + return marketDays; + } private History history; |