[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Su
Brought to you by:
glauco_1
|
From: <gla...@us...> - 2003-11-09 19:42:18
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
In directory sc8-pr-cvs1:/tmp/cvs-serv12653/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables
Modified Files:
Summary.cs
Log Message:
- Added the Max equity drawdown.
- 'Total number of trades' now is computed by a
devoted object (it was a delegate before this revision)
Index: Summary.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Summary.cs 8 Nov 2003 20:57:54 -0000 1.1
--- Summary.cs 9 Nov 2003 19:42:15 -0000 1.2
***************
*** 4,7 ****
--- 4,8 ----
using QuantProject.Business.Financial.Instruments;
using QuantProject.Business.Financial.Accounting.Reporting;
+ using QuantProject.Business.Financial.Accounting.Reporting.SummaryRows;
namespace QuantProject.Business.Financial.Accounting.Reporting.Tables
***************
*** 10,15 ****
/// Summary description for Summary.
/// </summary>
! public class Summary : ReportTable
! {
private AccountReport accountReport;
private double totalPnl;
--- 11,16 ----
/// Summary description for Summary.
/// </summary>
! public class Summary : ReportTable
! {
private AccountReport accountReport;
private double totalPnl;
***************
*** 17,20 ****
--- 18,33 ----
private double finalAccountValue;
private long intervalDays;
+ public AccountReport AccountReport
+ {
+ get { return accountReport; }
+ }
+ public double TotalPnl
+ {
+ get { return totalPnl; }
+ }
+ public double FinalAccountValue
+ {
+ get { return finalAccountValue; }
+ }
public Summary( AccountReport accountReport ) :
base( accountReport.Name + " - Summary" )
***************
*** 65,83 ****
// r = [(1+T)^(1/n)]-1
}
- private void getSummaryTable_setRow_MaxEquityDrawdown( DataRow summary )
- {
- // double totalROA = this.totalPnl / ( this.finalAccountValue - this.totalPnl );
- // summary[ "Information" ] = "Annual system % return";
- // summary[ "Value" ] = ( ( Math.Pow( 1 + totalROA ,
- // 1.0 / ( (double)this.intervalDays/365.0 ) ) ) - 1 ) * 100;
- // // r = [(1+T)^(1/n)]-1
- }
- private void getSummaryTable_setRow_TotalNumberOfTrades( DataRow summary )
- {
- double totalROA = this.totalPnl / ( this.finalAccountValue - this.totalPnl );
- summary[ "Information" ] = "Total # of trades";
- DataRow[] DataRows = this.accountReport.RoundTrades.DataTable.Select( "(ExitPrice is not null)" );
- summary[ "Value" ] = DataRows.Length;
- }
private void getSummaryTable_setRow_NumberWinningTrades( DataRow summary )
{
--- 78,81 ----
***************
*** 153,156 ****
--- 151,161 ----
summaryDataTable.Rows.Add( summary );
}
+ private void getSummary_setRow( SummaryRow summaryRow , DataTable summaryDataTable )
+ {
+ DataRow summary = summaryDataTable.NewRow();
+ summary[ "Information" ] = summaryRow.Description;
+ summary[ "Value" ] = summaryRow.Value;
+ summaryDataTable.Rows.Add( summary );
+ }
private void getSummaryTable_setRows( DataTable summaryDataTable )
{
***************
*** 163,170 ****
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_AnnualSystemPercentageReturn ) );
! getSummary_setRow( summaryDataTable ,
! new getSummaryTable_setRow( getSummaryTable_setRow_MaxEquityDrawdown ) );
! getSummary_setRow( summaryDataTable ,
! new getSummaryTable_setRow( getSummaryTable_setRow_TotalNumberOfTrades ) );
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_NumberWinningTrades ) );
--- 168,173 ----
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_AnnualSystemPercentageReturn ) );
! getSummary_setRow( new MaxEquityDrawDown( this ) , summaryDataTable );
! getSummary_setRow( new TotalNumberOfTrades( this ) , summaryDataTable );
getSummary_setRow( summaryDataTable ,
new getSummaryTable_setRow( getSummaryTable_setRow_NumberWinningTrades ) );
|