[Quantproject-developers] QuantProject/b4_Business/a2_Strategies EndOfDayStrategyBackTester.cs, 1.6
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2008-03-12 22:02:14
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6068/a2_Strategies Modified Files: EndOfDayStrategyBackTester.cs Log Message: The strategy's account is set directly in the backtester constructor; the account is initialized by a IAccountProvider object Index: EndOfDayStrategyBackTester.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a2_Strategies/EndOfDayStrategyBackTester.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EndOfDayStrategyBackTester.cs 7 Mar 2008 23:27:13 -0000 1.6 --- EndOfDayStrategyBackTester.cs 12 Mar 2008 22:02:06 -0000 1.7 *************** *** 29,32 **** --- 29,33 ---- using QuantProject.Business.Financial.Accounting; using QuantProject.Business.Financial.Accounting.Reporting; + using QuantProject.Business.Financial.Accounting.AccountProviding; using QuantProject.Business.Financial.Ordering; using QuantProject.Business.Strategies.Logging; *************** *** 50,54 **** private double cashToStart; private double maxRunningHours; ! private DateTime startingTimeForScript; private IEndOfDayTimer endOfDayTimer; --- 51,55 ---- private double cashToStart; private double maxRunningHours; ! private IAccountProvider accountProvider; private DateTime startingTimeForScript; private IEndOfDayTimer endOfDayTimer; *************** *** 123,130 **** "_to_" + ExtendedDateTime.GetShortDescriptionForFileName( this.actualLastDateTime ) + ! "_annlRtrn_" + this.AccountReport.Summary.AnnualSystemPercentageReturn.FormattedValue + ! "_maxDD_" + this.AccountReport.Summary.MaxEquityDrawDown.FormattedValue + ! "_" + this.historicalQuoteProvider.Description + ! "_" + this.endOfDayStrategy.Description; return description; } --- 124,131 ---- "_to_" + ExtendedDateTime.GetShortDescriptionForFileName( this.actualLastDateTime ) + ! "\n_annlRtrn_" + this.AccountReport.Summary.AnnualSystemPercentageReturn.FormattedValue + ! "\n_maxDD_" + this.AccountReport.Summary.MaxEquityDrawDown.FormattedValue + ! "\nHistoricalQuoteProviderForBackTester_" + this.historicalQuoteProvider.Description + ! "\n_" + this.endOfDayStrategy.Description; return description; } *************** *** 142,145 **** --- 143,147 ---- IEndOfDayStrategyForBacktester endOfDayStrategy , IHistoricalQuoteProvider historicalQuoteProvider , + IAccountProvider accountProvider, DateTime firstDateTime , DateTime lastDateTime , Benchmark benchmark , *************** *** 150,153 **** --- 152,156 ---- this.endOfDayStrategy = endOfDayStrategy; this.historicalQuoteProvider = historicalQuoteProvider; + this.accountProvider = accountProvider; this.firstDateTime = firstDateTime; this.lastDateTime = lastDateTime; *************** *** 157,161 **** this.initialize_endOfDayTimer(); ! this.initialize_account(); this.backTestLog = new BackTestLog( backTestID , firstDateTime , lastDateTime , benchmark ); --- 160,166 ---- this.initialize_endOfDayTimer(); ! this.account = this.accountProvider.GetAccount(this.endOfDayTimer, ! this.historicalQuoteProvider); ! this.endOfDayStrategy.Account = this.account; this.backTestLog = new BackTestLog( backTestID , firstDateTime , lastDateTime , benchmark ); *************** *** 173,186 **** this.benchmark.Ticker ); } ! private void initialize_account() ! { ! this.account = new Account( this.backTestID , this.endOfDayTimer , ! new HistoricalEndOfDayDataStreamer( this.endOfDayTimer , ! this.historicalQuoteProvider ) , ! new HistoricalEndOfDayOrderExecutor( this.endOfDayTimer , ! this.historicalQuoteProvider ) ); ! } ! ! #region Run #region run_addEventHandlers --- 178,182 ---- this.benchmark.Ticker ); } ! #region Run #region run_addEventHandlers |