[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRo
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-03-30 23:48:32
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17052/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Added Files: BenchmarkPercentageReturn.cs Log Message: BenchmarkPercentageReturn.cs replaces BuyAndHoldPercentageReturn.cs --- NEW FILE: BenchmarkPercentageReturn.cs --- using System; using System.Data; using QuantProject.ADT; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.Reporting.Tables; using QuantProject.Business.Financial.Instruments; using QuantProject.Business.Timing; namespace QuantProject.Business.Financial.Accounting.Reporting.SummaryRows { /// <summary> /// Percentage return for the Benchmark /// </summary> [Serializable] public class BenchmarkPercentageReturn : SummaryRow { 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 = summary.BenchmarkPercentageReturn; } } } } |