[Quantproject-developers] QuantProject/b5_Presentation/Reporting/WindowsForm EquityChartTabPage.cs,1
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-04-17 02:15:36
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13173/b5_Presentation/Reporting/WindowsForm Modified Files: EquityChartTabPage.cs Log Message: The BenchmarkEquityLine is now computed so that it contains data for exactly the same dates as the EquityHistory. PreviousInterpolator is used as interpolator method Index: EquityChartTabPage.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/EquityChartTabPage.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EquityChartTabPage.cs 30 Mar 2005 23:50:13 -0000 1.4 --- EquityChartTabPage.cs 17 Apr 2005 02:15:28 -0000 1.5 *************** *** 39,43 **** private AccountReport accountReport; private Chart equityChart; - private History equity = new History(); private History benchmark; --- 39,42 ---- *************** *** 50,65 **** 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 ); --- 49,56 ---- private History getBenchmark() { ! DateTime firstDate = ! (DateTime)this.accountReport.EquityHistory.GetKey( 0 ); double normalizingFactor = ! ( double )this.accountReport.EquityHistory[ firstDate ] / Convert.ToDouble( this.accountReport.BenchmarkEquityLine[ firstDate ] ); return this.accountReport.BenchmarkEquityLine.MultiplyBy( normalizingFactor ); *************** *** 71,91 **** this.equityChart = new Chart(); this.equityChart.Dock = DockStyle.Fill; ! this.equity.Import( this.accountReport.Equity.DataTable , ! QuantProject.Business.Financial.Accounting.Reporting.Tables.Equity.Date , ! QuantProject.Business.Financial.Accounting.Reporting.Tables.Equity.AccountValue ); ! this.equityChart.Add( equity , Color.Red ); this.benchmark = this.getBenchmark(); ! this.equityChart.Add( benchmark , Color.Blue , (DateTime)this.equity.GetKey( 0 ) , ! (DateTime)this.equity.GetKey( this.equity.Count - 1 ) ); this.Controls.Add( this.equityChart ); } - // protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) - // { - // this.VisualValidationDataGrid.Height = this.Height - 10; - // this.VisualValidationChart.PrecedingDays = ConstantsProvider.PrecedingDaysForVisualValidation; - // this.VisualValidationChart.Width = this.Width - this.VisualValidationDataGridWidth - 5; - // this.VisualValidationChart.Height = this.Height - 10; - // base.OnPaint( e ); - // } } } --- 62,73 ---- this.equityChart = new Chart(); this.equityChart.Dock = DockStyle.Fill; ! this.equityChart.Add( accountReport.EquityHistory , Color.Red ); this.benchmark = this.getBenchmark(); ! // this.equityChart.Add( benchmark , Color.Blue , ! // (DateTime)this.accountReport.EquityHistory.GetKey( 0 ) , ! // (DateTime)this.accountReport.EquityHistory.GetKey( this.accountReport.EquityHistory.Count - 1 ) ); ! this.equityChart.Add( benchmark , Color.Blue ); this.Controls.Add( this.equityChart ); } } } |