[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Su
Brought to you by:
glauco_1
|
From: <gla...@us...> - 2003-11-13 23:22:47
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
In directory sc8-pr-cvs1:/tmp/cvs-serv13706/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
Modified Files:
Summary.cs
Log Message:
Updated the Account Report Summary object:
- 'Buy and hold percentage return' now is computed by a
devoted object (it was a delegate before this revision)
- 'Return on account' now is computed by a
devoted object (previous revision was still invoking the delegate, even
if the object was already defined and committed)
Index: Summary.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Summary.cs 10 Nov 2003 21:34:45 -0000 1.3
--- Summary.cs 13 Nov 2003 23:22:43 -0000 1.4
***************
*** 26,29 ****
--- 26,34 ----
get { return totalPnl; }
}
+ public double BuyAndHoldPercentageReturn
+ {
+ get { return buyAndHoldPercentageReturn; }
+ set { buyAndHoldPercentageReturn = value; }
+ }
public double FinalAccountValue
{
***************
*** 44,68 ****
#region "getSummaryTable_setRows"
private delegate void getSummaryTable_setRow( DataRow summary );
- private void getSummaryTable_setRow_ReturnOnAccount( DataRow summary )
- {
- summary[ "Information" ] = "Return on account";
- summary[ "Value" ] = this.totalPnl / ( this.finalAccountValue - this.totalPnl ) * 100;
- }
- private void getSummaryTable_setRow_BuyAndHoldPercentageReturn( DataRow summary )
- {
- if ( this.accountReport.BuyAndHoldTicker != "" )
- {
- // the report has to compare to a buy and hold benchmark
- Instrument buyAndHoldInstrument = new Instrument( this.accountReport.BuyAndHoldTicker );
- this.buyAndHoldPercentageReturn =
- ( buyAndHoldInstrument.GetMarketValue( this.accountReport.EndDateTime ) -
- buyAndHoldInstrument.GetMarketValue(
- new ExtendedDateTime( this.accountReport.StartDateTime , BarComponent.Open ) ) ) /
- buyAndHoldInstrument.GetMarketValue(
- new ExtendedDateTime( this.accountReport.StartDateTime , BarComponent.Open ) ) * 100;
- summary[ "Information" ] = "Buy & hold % return";
- summary[ "Value" ] = this.buyAndHoldPercentageReturn;
- }
- }
private void getSummaryTable_setRow_AnnualSystemPercentageReturn( DataRow summary )
{
--- 49,52 ----
***************
*** 156,163 ****
{
getSummary_setRow( new TotalNetProfit( this ) , summaryDataTable );
! getSummary_setRow( summaryDataTable ,
! new getSummaryTable_setRow( getSummaryTable_setRow_ReturnOnAccount ) );
! getSummary_setRow( summaryDataTable ,
! new getSummaryTable_setRow( getSummaryTable_setRow_BuyAndHoldPercentageReturn ) );
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_AnnualSystemPercentageReturn ) );
--- 140,145 ----
{
getSummary_setRow( new TotalNetProfit( this ) , summaryDataTable );
! getSummary_setRow( new ReturnOnAccount( this ) , summaryDataTable );
! getSummary_setRow( new BuyAndHoldPercentageReturn( this ) , summaryDataTable );
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_AnnualSystemPercentageReturn ) );
|