[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag RunWalkForwardLa
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2006-05-31 14:23:06
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv7394/b7_Scripts/WalkForwardTesting/WalkForwardLag Modified Files: RunWalkForwardLag.cs Log Message: Script changed so that now, the out of sample days are computed after the last optimization, when maxRunningHours has been reached (in the previous implementation, the last optimization was performed, but the script was stopped before computing the out of sample test). Index: RunWalkForwardLag.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/WalkForwardLag/RunWalkForwardLag.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunWalkForwardLag.cs 14 May 2006 23:00:17 -0000 1.3 --- RunWalkForwardLag.cs 31 May 2006 14:22:53 -0000 1.4 *************** *** 224,236 **** report.Show(); } ! private void oneHourAfterMarketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { DateTime currentTime = ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; ! if ( ( currentTime > ! this.lastDateTime ) || ! ( DateTime.Now >= ! this.startingTimeForScript.AddHours( this.maxRunningHours ) ) ) { // either the simulation has reached the ending date or --- 224,244 ---- report.Show(); } ! private bool isTimeToStop( DateTime currentTime ) ! { ! DateTime maxEndingDateTimeForScript = ! this.startingTimeForScript.AddHours( this.maxRunningHours ); ! bool scriptTimeElapsed = ( DateTime.Now >= maxEndingDateTimeForScript ); ! bool areBestTickersToBeChosen = ! this.endOfDayTimerHandler.AreBestTickersToBeChosen(); ! return ! ( ( currentTime > this.lastDateTime ) || ! ( scriptTimeElapsed && areBestTickersToBeChosen ) ); ! } ! private void marketCloseEventHandler( Object sender , EndOfDayTimingEventArgs endOfDayTimingEventArgs ) { DateTime currentTime = ( ( IEndOfDayTimer )sender ).GetCurrentTime().DateTime; ! if ( this.isTimeToStop( currentTime ) ) { // either the simulation has reached the ending date or *************** *** 273,279 **** new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); ! this.endOfDayTimer.OneHourAfterMarketClose += ! new OneHourAfterMarketCloseEventHandler( ! this.oneHourAfterMarketCloseEventHandler ); this.endOfDayTimerHandler.NewChosenTickers += new NewChosenTickersEventHandler( --- 281,287 ---- new OneHourAfterMarketCloseEventHandler( this.endOfDayTimerHandler.OneHourAfterMarketCloseEventHandler ); ! this.endOfDayTimer.MarketClose += ! new MarketCloseEventHandler( ! this.marketCloseEventHandler ); this.endOfDayTimerHandler.NewChosenTickers += new NewChosenTickersEventHandler( |