[Quantproject-developers] QuantProject/b3_Data/DataTables Quotes.cs,1.23,1.24
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-02-19 17:58:19
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22478/b3_Data/DataTables Modified Files: Quotes.cs Log Message: The method GetFollowingDate( DateTime quoteDate , int followingDays ) has been improved: now an exception is thrown when no quote is available at the requested following date. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Quotes.cs 8 Jan 2006 23:38:43 -0000 1.23 --- Quotes.cs 19 Feb 2006 17:58:13 -0000 1.24 *************** *** 767,773 **** { setHistory(); ! return (DateTime) history.GetKey( Math.Max( 0 , ! history.IndexOfKeyOrPrevious( quoteDate ) + ! followingDays ) ); } --- 767,786 ---- { setHistory(); ! int indexOfKeyOrPrevious = ! history.IndexOfKeyOrPrevious( quoteDate ); ! DateTime followingDate; ! try ! { ! followingDate = (DateTime) history.GetKey( Math.Max( 0 , ! indexOfKeyOrPrevious + followingDays ) ); ! } ! catch ( ArgumentOutOfRangeException exception ) ! { ! string message = exception.Message; ! throw new Exception( "Quotes.GetFollowingDate() error: there is not " + ! "a date for quoteDate=" + quoteDate.ToString() + ! " and followingDays=" + followingDays ); ! } ! return followingDate; } |