[Quantproject-developers] QuantProject/b4_Business/a2_Strategies EndOfDayStrategyBackTester.cs, 1.1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-11-24 21:03:54
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27574/b4_Business/a2_Strategies Modified Files: EndOfDayStrategyBackTester.cs Log Message: the code to manage the last date time of the script has been slightly changed Index: EndOfDayStrategyBackTester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategyBackTester.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** EndOfDayStrategyBackTester.cs 22 Nov 2008 18:26:20 -0000 1.14 --- EndOfDayStrategyBackTester.cs 24 Nov 2008 21:03:42 -0000 1.15 *************** *** 62,66 **** private DateTime startingTimeForScript; private Timer timer; ! private DateTime actualLastDateTime; private Account account; private AccountReport accountReport; --- 62,66 ---- private DateTime startingTimeForScript; private Timer timer; ! private DateTime lastDateTimeThrownOutByTheTimer; private Account account; private AccountReport accountReport; *************** *** 96,100 **** { this.checkThisPropertyRequiresBacktestIsCompleted(); ! return this.actualLastDateTime; } } --- 96,100 ---- { this.checkThisPropertyRequiresBacktestIsCompleted(); ! return this.lastDateTimeThrownOutByTheTimer; } } *************** *** 142,146 **** ExtendedDateTime.GetShortDescriptionForFileName( this.firstDateTime ) + "_to_" + ! ExtendedDateTime.GetShortDescriptionForFileName( this.actualLastDateTime ) + "_annlRtrn_" + this.AccountReport.Summary.AnnualSystemPercentageReturn.FormattedValue + "_maxDD_" + this.AccountReport.Summary.MaxEquityDrawDown.FormattedValue + --- 142,146 ---- ExtendedDateTime.GetShortDescriptionForFileName( this.firstDateTime ) + "_to_" + ! ExtendedDateTime.GetShortDescriptionForFileName( this.lastDateTimeThrownOutByTheTimer ) + "_annlRtrn_" + this.AccountReport.Summary.AnnualSystemPercentageReturn.FormattedValue + "_maxDD_" + this.AccountReport.Summary.MaxEquityDrawDown.FormattedValue + *************** *** 196,200 **** this.backTestLog = new BackTestLog( backTestID , firstDateTime , lastDateTime , benchmark ); ! this.actualLastDateTime = DateTime.MinValue; this.realDateTimeWhenTheBackTestIsStopped = DateTime.MinValue; } --- 196,200 ---- this.backTestLog = new BackTestLog( backTestID , firstDateTime , lastDateTime , benchmark ); ! this.lastDateTimeThrownOutByTheTimer = DateTime.MinValue; this.realDateTimeWhenTheBackTestIsStopped = DateTime.MinValue; } *************** *** 298,305 **** private void completeTheScript() { this.realDateTimeWhenTheBackTestIsStopped = DateTime.Now; this.accountReport = this.account.CreateReport( "" , 1 , ! this.actualLastDateTime , this.benchmark.Ticker , this.historicalMarketValueProvider ); this.accountReport.Name = this.Description; --- 298,306 ---- private void completeTheScript() { + this.timer.Stop(); this.realDateTimeWhenTheBackTestIsStopped = DateTime.Now; this.accountReport = this.account.CreateReport( "" , 1 , ! this.lastDateTimeThrownOutByTheTimer , this.benchmark.Ticker , this.historicalMarketValueProvider ); this.accountReport.Name = this.Description; *************** *** 350,359 **** #endregion isTimeToStop ! #region stopTheScript private void stopTheScript( DateTime currentDateTime ) { // this.actualLastDateTime = // ExtendedDateTime.Min( this.lastDateTime , currentDateTime ); ! this.actualLastDateTime = ExtendedDateTime.Min( this.lastDateTime , this.timer.GetCurrentDateTime() ); --- 351,360 ---- #endregion isTimeToStop ! #region stopTheScriptIfTheCase private void stopTheScript( DateTime currentDateTime ) { // this.actualLastDateTime = // ExtendedDateTime.Min( this.lastDateTime , currentDateTime ); ! this.lastDateTimeThrownOutByTheTimer = ExtendedDateTime.Min( this.lastDateTime , this.timer.GetCurrentDateTime() ); *************** *** 378,382 **** // } // } ! #endregion stopTheScript private void notifyProgress( --- 379,383 ---- // } // } ! #endregion stopTheScriptIfTheCase private void notifyProgress( *************** *** 399,402 **** --- 400,404 ---- // ( ( IEndOfDayTimer )sender ).GetCurrentTime(); // DateTime currentDateTime = currentEndOfDayDateTime.DateTime; + this.lastDateTimeThrownOutByTheTimer = dateTime; if ( this.isTimeToStop( dateTime ) ) this.stopTheScript( dateTime ); |