[Quantproject-developers] QuantProject/b3_Data/DataTables Quotes.cs,1.9,1.10
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-01-08 11:52:11
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27097/b3_Data/DataTables Modified Files: Quotes.cs Log Message: Added methods for getting first valid raw (not adjusted) values for open and close, at a given date Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Quotes.cs 28 Aug 2004 17:18:06 -0000 1.9 --- Quotes.cs 8 Jan 2005 11:51:57 -0000 1.10 *************** *** 504,507 **** --- 504,533 ---- } + /// <summary> + /// Gets the first valid raw (not adjusted) close at the given date + /// </summary> + /// <returns></returns> + public float GetFirstValidRawClose(DateTime date ) + { + object[] keys = new object[1]; + keys[0] = this.GetFirstValidQuoteDate(date.Date); + DataRow foundRow = this.Rows.Find(keys); + if(foundRow==null) + throw new Exception("No quote for such a date!"); + return (float)foundRow[Quotes.Close]; + } + /// <summary> + /// Gets the first valid raw (not adjusted) open at the given date + /// </summary> + /// <returns></returns> + public float GetFirstValidRawOpen(DateTime date ) + { + object[] keys = new object[1]; + keys[0] = this.GetFirstValidQuoteDate(date.Date); + DataRow foundRow = this.Rows.Find(keys); + if(foundRow==null) + throw new Exception("No quote for such a date!"); + return (float)foundRow[Quotes.Open]; + } // public DateTime GetPrecedingDate( DateTime quoteDate , int precedingDays ) |