[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRo
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2005-02-19 15:59:02
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16078/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: NumberWinningLongTrades.cs NumberWinningShortTrades.cs NumberWinningTrades.cs TotalNumberOfLongTrades.cs TotalNumberOfShortTrades.cs Log Message: Added try catch to avoid run time errors when there are no round trades Index: NumberWinningLongTrades.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/NumberWinningLongTrades.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NumberWinningLongTrades.cs 15 Feb 2005 19:09:03 -0000 1.2 --- NumberWinningLongTrades.cs 19 Feb 2005 15:58:52 -0000 1.3 *************** *** 16,21 **** { this.rowDescription = "Number winning long trades"; ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Long')and([%Profit] > 0))" ); ! this.rowValue = DataRows.Length; } } --- 16,28 ---- { this.rowDescription = "Number winning long trades"; ! try ! { ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Long')and([%Profit] > 0))" ); ! this.rowValue = DataRows.Length; ! } ! catch (Exception ex) ! { ! ex = ex; // to avoid compilation warning; ! } } } Index: NumberWinningShortTrades.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/NumberWinningShortTrades.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NumberWinningShortTrades.cs 15 Feb 2005 19:09:03 -0000 1.2 --- NumberWinningShortTrades.cs 19 Feb 2005 15:58:52 -0000 1.3 *************** *** 16,22 **** { this.rowDescription = "Number winning short trades"; ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( ! "((Trade='Short')and([%Profit] > 0))" ); ! this.rowValue = DataRows.Length; } } --- 16,29 ---- { this.rowDescription = "Number winning short trades"; ! try ! { ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( ! "((Trade='Short')and([%Profit] > 0))" ); ! this.rowValue = DataRows.Length; ! } ! catch (Exception ex) ! { ! ex = ex; // to avoid compilation warning; ! } } } Index: TotalNumberOfShortTrades.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/TotalNumberOfShortTrades.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TotalNumberOfShortTrades.cs 15 Feb 2005 19:09:04 -0000 1.2 --- TotalNumberOfShortTrades.cs 19 Feb 2005 15:58:52 -0000 1.3 *************** *** 17,23 **** double totalROA = summary.TotalPnl / ( summary.FinalAccountValue - summary.TotalPnl ); this.rowDescription = "Total # of short trades"; ! DataRow[] DataRows = ! summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Short')and(ExitPrice is not null))" ); ! this.rowValue = DataRows.Length; } } --- 17,30 ---- double totalROA = summary.TotalPnl / ( summary.FinalAccountValue - summary.TotalPnl ); this.rowDescription = "Total # of short trades"; ! try ! { ! DataRow[] DataRows = ! summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Short')and(ExitPrice is not null))" ); ! this.rowValue = DataRows.Length; ! } ! catch (Exception ex) ! { ! ex = ex; // to avoid compilation warning; ! } } } Index: TotalNumberOfLongTrades.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/TotalNumberOfLongTrades.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TotalNumberOfLongTrades.cs 15 Feb 2005 19:09:04 -0000 1.2 --- TotalNumberOfLongTrades.cs 19 Feb 2005 15:58:52 -0000 1.3 *************** *** 17,23 **** double totalROA = summary.TotalPnl / ( summary.FinalAccountValue - summary.TotalPnl ); this.rowDescription = "Total # of long trades"; ! DataRow[] DataRows = ! summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Long')and(ExitPrice is not null))" ); ! this.rowValue = DataRows.Length; } } --- 17,30 ---- double totalROA = summary.TotalPnl / ( summary.FinalAccountValue - summary.TotalPnl ); this.rowDescription = "Total # of long trades"; ! try ! { ! DataRow[] DataRows = ! summary.AccountReport.RoundTrades.DataTable.Select( "((Trade='Long')and(ExitPrice is not null))" ); ! this.rowValue = DataRows.Length; ! } ! catch (Exception ex) ! { ! ex = ex; // to avoid compilation warning; ! } } } Index: NumberWinningTrades.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/NumberWinningTrades.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NumberWinningTrades.cs 15 Feb 2005 19:09:04 -0000 1.2 --- NumberWinningTrades.cs 19 Feb 2005 15:58:52 -0000 1.3 *************** *** 16,21 **** { this.rowDescription = "Number winning trades"; ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( "([%Profit] > 0)" ); ! this.rowValue = DataRows.Length; } } --- 16,28 ---- { this.rowDescription = "Number winning trades"; ! try ! { ! DataRow[] DataRows = summary.AccountReport.RoundTrades.DataTable.Select( "([%Profit] > 0)" ); ! this.rowValue = DataRows.Length; ! } ! catch (Exception ex) ! { ! ex = ex; // to avoid compilation warning; ! } } } |