[Quantproject-developers] QuantProject/b5_Presentation/Reporting/WindowsForm EquityChartTabPage.cs,1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-03-30 23:50:39
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18353/b5_Presentation/Reporting/WindowsForm Modified Files: EquityChartTabPage.cs Log Message: AccountReport now contains the Benchmark equity line, so it has become database independent. Index: EquityChartTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/EquityChartTabPage.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EquityChartTabPage.cs 20 Jan 2005 01:25:54 -0000 1.3 --- EquityChartTabPage.cs 30 Mar 2005 23:50:13 -0000 1.4 *************** *** 24,28 **** using System.Windows.Forms; using QuantProject.ADT.Histories; ! using QuantProject.Data.DataProviders; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.Reporting; --- 24,28 ---- using System.Windows.Forms; using QuantProject.ADT.Histories; ! //using QuantProject.Data.DataProviders; using QuantProject.Business.DataProviders; using QuantProject.Business.Financial.Accounting.Reporting; *************** *** 50,64 **** private History getBenchmark() { ! History buyAndHoldTickerEquityLine = ! HistoricalDataProvider.GetAdjustedCloseHistory( ! this.accountReport.BuyAndHoldTicker ); ! HistoricalAdjustedQuoteProvider quoteProvider = ! new HistoricalAdjustedQuoteProvider(); DateTime firstDate = (DateTime)this.equity.GetKey( 0 ); double normalizingFactor = ( double )this.equity[ firstDate ] / ! ( double )quoteProvider.GetMarketValue( this.accountReport.BuyAndHoldTicker , ! new EndOfDayDateTime( firstDate , EndOfDaySpecificTime.MarketClose ) ); ! return buyAndHoldTickerEquityLine.MultiplyBy( normalizingFactor ); } public EquityChartTabPage( AccountReport accountReport ) --- 50,67 ---- private History getBenchmark() { ! // History buyAndHoldTickerEquityLine = ! // HistoricalDataProvider.GetAdjustedCloseHistory( ! // this.accountReport.BuyAndHoldTicker ); ! // HistoricalAdjustedQuoteProvider quoteProvider = ! // new HistoricalAdjustedQuoteProvider(); ! // DateTime firstDate = (DateTime)this.equity.GetKey( 0 ); ! // double normalizingFactor = ! // ( double )this.equity[ firstDate ] / ! // ( double )quoteProvider.GetMarketValue( this.accountReport.BuyAndHoldTicker ,ù DateTime firstDate = (DateTime)this.equity.GetKey( 0 ); double normalizingFactor = ( double )this.equity[ firstDate ] / ! Convert.ToDouble( this.accountReport.BenchmarkEquityLine[ firstDate ] ); ! return this.accountReport.BenchmarkEquityLine.MultiplyBy( normalizingFactor ); } public EquityChartTabPage( AccountReport accountReport ) |