[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryR
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2007-12-07 19:08:42
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27141/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows Modified Files: AverageNumberOfTransactionsPerDay.cs Log Message: Number of transactions is divided by number of market days, now. Index: AverageNumberOfTransactionsPerDay.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/SummaryRows/AverageNumberOfTransactionsPerDay.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AverageNumberOfTransactionsPerDay.cs 10 Sep 2007 22:08:37 -0000 1.2 --- AverageNumberOfTransactionsPerDay.cs 7 Dec 2007 19:08:37 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- using QuantProject.ADT.Histories; using QuantProject.ADT.Statistics; + using QuantProject.Data.DataTables; using QuantProject.Business.Financial.Accounting.Reporting.Tables; *************** *** 37,49 **** public class AverageNumberOfTransactionsPerDay : DoubleSummaryRow { ! public AverageNumberOfTransactionsPerDay( Summary summary ) : base( 1 ) { ! this.rowDescription = "Average n. of transactions per day"; //int totalNumberOfTransactions = summary.AccountReport.Account.Transactions.Count; //there must be a mistake somewhere: why the previous line is not right? int totalNumberOfTransactions = summary.AccountReport.TransactionTable.DataTable.Rows.Count; ! TimeSpan timeSpanForScript = ! summary.AccountReport.EndDateTime.DateTime.Subtract(summary.AccountReport.StartDateTime); ! this.rowValue = (double)totalNumberOfTransactions / (double)timeSpanForScript.Days; } } --- 38,52 ---- public class AverageNumberOfTransactionsPerDay : DoubleSummaryRow { ! public AverageNumberOfTransactionsPerDay( Summary summary ) : base( 2 ) { ! this.rowDescription = "Average n. of transactions per market day"; //int totalNumberOfTransactions = summary.AccountReport.Account.Transactions.Count; //there must be a mistake somewhere: why the previous line is not right? int totalNumberOfTransactions = summary.AccountReport.TransactionTable.DataTable.Rows.Count; ! History marketDays = Quotes.GetMarketDays( ! summary.AccountReport.Benchmark, ! summary.AccountReport.StartDateTime, ! summary.AccountReport.EndDateTime.DateTime); ! this.rowValue = (double)totalNumberOfTransactions / (double)marketDays.Count; } } |