[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Su
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-03-20 18:31:08
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23877/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables Modified Files: Summary.cs Log Message: Now, when a Summary row is null, zero is returned. This is done to avoid run time errors when no round trade is found. Index: Summary.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/Tables/Summary.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Summary.cs 15 Feb 2005 19:09:05 -0000 1.12 --- Summary.cs 20 Mar 2005 18:30:59 -0000 1.13 *************** *** 58,107 **** public double MaxEquityDrawDown { ! get { return (double)this.maxEquityDrawDown.rowValue; } } public double TotalNumberOfTrades { ! get { return (int)this.totalNumberOfTrades.rowValue; } } public int NumberWinningTrades { ! get { return (int)this.numberWinningTrades.rowValue; } } public double AverageTradePercentageReturn { ! get { return (double)this.averageTradePercentageReturn.rowValue; } } public double LargestWinningTradePercentage { ! get { return (double)this.largestWinningTradePercentage.rowValue; } } public double LargestLosingTradePercentage { ! get { return (double)this.largestLosingTradePercentage.rowValue; } } public double NumberWinningLongTrades { ! get { return (int)this.numberWinningLongTrades.rowValue; } } public double AverageLongTradePercentageReturn { ! get { return (double)this.averageLongTradePercentageReturn.rowValue; } } public double NumberWinningShortTrades { ! get { return (int)this.numberWinningShortTrades.rowValue; } } public double TotalNumberOfLongTrades { ! get { return (int)this.totalNumberOfLongTrades.rowValue; } } public double TotalNumberOfShortTrades { ! get { return (int)this.totalNumberOfShortTrades.rowValue; } } public double TotalCommissionAmount { ! get { return (double)this.totalCommissionAmount.rowValue; } } --- 58,107 ---- public double MaxEquityDrawDown { ! get { return Convert.ToDouble( this.maxEquityDrawDown.Value ); } } public double TotalNumberOfTrades { ! get { return (int)this.totalNumberOfTrades.Value; } } public int NumberWinningTrades { ! get { return (int)this.numberWinningTrades.Value; } } public double AverageTradePercentageReturn { ! get { return Convert.ToDouble( this.averageTradePercentageReturn.Value ); } } public double LargestWinningTradePercentage { ! get { return Convert.ToDouble( this.largestWinningTradePercentage.Value ); } } public double LargestLosingTradePercentage { ! get { return Convert.ToDouble( this.largestLosingTradePercentage.Value ); } } public double NumberWinningLongTrades { ! get { return (int)this.numberWinningLongTrades.Value; } } public double AverageLongTradePercentageReturn { ! get { return Convert.ToDouble( this.averageLongTradePercentageReturn.Value ); } } public double NumberWinningShortTrades { ! get { return (int)this.numberWinningShortTrades.Value; } } public double TotalNumberOfLongTrades { ! get { return (int)this.totalNumberOfLongTrades.Value; } } public double TotalNumberOfShortTrades { ! get { return (int)this.totalNumberOfShortTrades.Value; } } public double TotalCommissionAmount { ! get { return Convert.ToDouble( this.totalCommissionAmount.Value ); } } *************** *** 189,192 **** --- 189,194 ---- private void getSummary() { + if ( this.accountReport.Equity.DataTable.Rows.Count == 0 ) + throw new Exception( "A Summary computation has been requested, but the equity line is empty" ); this.totalPnl = (double)this.accountReport.Equity.DataTable.Rows[ this.accountReport.Equity.DataTable.Rows.Count - 1 ][ "PnL" ]; |