[Quantproject-developers] QuantProject/b3_Data/DataTables Quotes.cs,1.2,1.3
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-05-27 16:45:57
|
Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4563/b3_Data/DataTables Modified Files: Quotes.cs Log Message: Performance optimization: the private setHistory variable is introduced and the the setHistory method (to create such new private variable) is introduced. Index: Quotes.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Quotes.cs 26 May 2004 15:30:10 -0000 1.2 --- Quotes.cs 27 May 2004 16:45:38 -0000 1.3 *************** *** 25,28 **** --- 25,30 ---- public static string AdjustedCloseToCloseRatio = "quAdjustedCloseToCloseRatio"; + private History history; + /// <summary> /// Gets the ticker whose quotes are contained into the Quotes object *************** *** 120,123 **** --- 122,134 ---- #endregion + private void setHistory() + { + if ( this.history == null ) + // history has not been set, yet + { + this.history = new History(); + this.history.Import( this , "quDate" , "quAdjustedClose" ); + } + } /// <summary> /// returns the Date for the quote that is precedingDays before *************** *** 129,134 **** public DateTime GetPrecedingDate( DateTime quoteDate , int precedingDays ) { ! History history = new History(); ! history.Import( this , "quDate" , "quAdjustedClose" ); return (DateTime) history.GetKey( Math.Max( 0 , history.IndexOfKeyOrPrevious( quoteDate ) - --- 140,144 ---- public DateTime GetPrecedingDate( DateTime quoteDate , int precedingDays ) { ! setHistory(); return (DateTime) history.GetKey( Math.Max( 0 , history.IndexOfKeyOrPrevious( quoteDate ) - *************** *** 146,151 **** public DateTime GetFollowingDate( DateTime quoteDate , int followingDays ) { ! History history = new History(); ! history.Import( this , "quDate" , "quAdjustedClose" ); return (DateTime) history.GetKey( Math.Max( 0 , history.IndexOfKeyOrPrevious( quoteDate ) - --- 156,160 ---- public DateTime GetFollowingDate( DateTime quoteDate , int followingDays ) { ! setHistory(); return (DateTime) history.GetKey( Math.Max( 0 , history.IndexOfKeyOrPrevious( quoteDate ) - |