[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryR
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-09-29 21:14:03
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13426/a2_Accounting/h5_Reporting/SummaryRows Modified Files: AverageNumberOfTransactionsPerDay.cs BenchmarkPercentageReturn.cs Log Message: The new revision moves toward an intraday enabled framework. EndOfDayDate time has been removed, DateTime is used now. The code has been changed accordingly. Index: BenchmarkPercentageReturn.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/BenchmarkPercentageReturn.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BenchmarkPercentageReturn.cs 19 Jun 2005 14:55:09 -0000 1.2 --- BenchmarkPercentageReturn.cs 29 Sep 2008 21:13:46 -0000 1.3 *************** *** 13,37 **** /// </summary> [Serializable] ! public class BenchmarkPercentageReturn : PercentageSummaryRow { public BenchmarkPercentageReturn( Summary summary , ! IHistoricalQuoteProvider historicalQuoteProvider ) { ! if ( summary.AccountReport.Benchmark != "" ) ! { ! // the report has to compare to a buy and hold benchmark ! double beginningMarketValue = historicalQuoteProvider.GetMarketValue( summary.AccountReport.Benchmark , ! new EndOfDayDateTime( summary.AccountReport.StartDateTime , EndOfDaySpecificTime.MarketOpen ) ); ! double finalMarketValue = historicalQuoteProvider.GetMarketValue( summary.AccountReport.Benchmark , ! summary.AccountReport.EndDateTime ); // summary.BenchmarkPercentageReturn = ( finalMarketValue - beginningMarketValue ) / // beginningMarketValue * 100; ! this.rowDescription = "Buy & hold % return"; this.rowValue = ( finalMarketValue - beginningMarketValue ) / beginningMarketValue * 100; ! } ! } } } --- 13,40 ---- /// </summary> [Serializable] ! public class BenchmarkPercentageReturn : PercentageSummaryRow { public BenchmarkPercentageReturn( Summary summary , ! HistoricalMarketValueProvider historicalMarketValueProvider ) { ! if ( summary.AccountReport.Benchmark != "" ) ! { ! // the report has to compare to a buy and hold benchmark ! double beginningMarketValue = historicalMarketValueProvider.GetMarketValue( summary.AccountReport.Benchmark , ! HistoricalEndOfDayTimer.GetMarketOpen( ! summary.AccountReport.StartDateTime ) ); ! // new EndOfDayDateTime( summary.AccountReport.StartDateTime , EndOfDaySpecificTime.MarketOpen ) ); ! double finalMarketValue = historicalMarketValueProvider.GetMarketValue( summary.AccountReport.Benchmark , ! HistoricalEndOfDayTimer.GetMarketClose( ! summary.AccountReport.EndDateTime ) ); // summary.BenchmarkPercentageReturn = ( finalMarketValue - beginningMarketValue ) / // beginningMarketValue * 100; ! this.rowDescription = "Buy & hold % return"; this.rowValue = ( finalMarketValue - beginningMarketValue ) / beginningMarketValue * 100; ! } ! } } } Index: AverageNumberOfTransactionsPerDay.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/AverageNumberOfTransactionsPerDay.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AverageNumberOfTransactionsPerDay.cs 7 Dec 2007 19:08:37 -0000 1.3 --- AverageNumberOfTransactionsPerDay.cs 29 Sep 2008 21:13:46 -0000 1.4 *************** *** 47,51 **** summary.AccountReport.Benchmark, summary.AccountReport.StartDateTime, ! summary.AccountReport.EndDateTime.DateTime); this.rowValue = (double)totalNumberOfTransactions / (double)marketDays.Count; } --- 47,51 ---- summary.AccountReport.Benchmark, summary.AccountReport.StartDateTime, ! summary.AccountReport.EndDateTime); this.rowValue = (double)totalNumberOfTransactions / (double)marketDays.Count; } |