[Quantproject-developers] QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting AccountRe
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2004-11-29 15:48:08
|
Update of /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11342/b4_Business/a1_Financial/a2_Accounting/h5_Reporting Modified Files: AccountReport.cs Log Message: ExtededDateTime has been replaced by EndOfDayDateTime Index: AccountReport.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b4_Business/a1_Financial/a2_Accounting/h5_Reporting/AccountReport.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AccountReport.cs 28 Nov 2003 15:37:13 -0000 1.7 --- AccountReport.cs 29 Nov 2004 15:47:59 -0000 1.8 *************** *** 29,33 **** --- 29,36 ---- using QuantProject.ADT; using QuantProject.ADT.Histories; + using QuantProject.Business.Financial.Accounting.Transactions; using QuantProject.Business.Financial.Instruments; + using QuantProject.Business.Timing; + namespace QuantProject.Business.Financial.Accounting.Reporting { *************** *** 40,44 **** private Account accountCopy = new Account( "AccountCopy" ); private string reportName; ! private ExtendedDateTime endDateTime; private string buyAndHoldTicker; //private long numDaysForInterval; --- 43,47 ---- private Account accountCopy = new Account( "AccountCopy" ); private string reportName; ! private EndOfDayDateTime endDateTime; private string buyAndHoldTicker; //private long numDaysForInterval; *************** *** 53,57 **** get { return reportName; } } ! public ExtendedDateTime EndDateTime { get { return endDateTime; } --- 56,60 ---- get { return reportName; } } ! public EndOfDayDateTime EndDateTime { get { return endDateTime; } *************** *** 120,139 **** } #region "setRows" ! private void addBalanceItems ( ExtendedDateTime extendedDateTime , DataRow dataRow ) { dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( ! extendedDateTime ); ! dataRow[ "AccountValue" ] = this.accountCopy.GetMarketValue( extendedDateTime ); ! dataRow[ "PnL" ] = this.accountCopy.GetMarketValue( extendedDateTime ) + this.accountCopy.Transactions.TotalWithdrawn - this.accountCopy.Transactions.TotalAddedCash; } ! private void addTransactionRow( TimedTransaction transaction , System.Data.DataTable detailedDataTable ) { DataRow dataRow = detailedDataTable.NewRow(); ! dataRow[ "DateTime" ] = transaction.ExtendedDateTime.DateTime; ! dataRow[ "BarComponent" ] = transaction.ExtendedDateTime.BarComponent.ToString(); dataRow[ "TransactionType" ] = transaction.Type.ToString(); if ( transaction.Instrument != null ) --- 123,142 ---- } #region "setRows" ! private void addBalanceItems ( EndOfDayDateTime endOfDayDateTime , DataRow dataRow ) { dataRow[ "AccountCash" ] = this.accountCopy.CashAmount; dataRow[ "PortfolioValue" ] = this.accountCopy.Portfolio.GetMarketValue( ! endOfDayDateTime ); ! dataRow[ "AccountValue" ] = this.accountCopy.GetMarketValue( endOfDayDateTime ); ! dataRow[ "PnL" ] = this.accountCopy.GetMarketValue( endOfDayDateTime ) + this.accountCopy.Transactions.TotalWithdrawn - this.accountCopy.Transactions.TotalAddedCash; } ! private void addTransactionRow( EndOfDayTransaction transaction , System.Data.DataTable detailedDataTable ) { DataRow dataRow = detailedDataTable.NewRow(); ! dataRow[ "DateTime" ] = transaction.EndOfDayDateTime.DateTime; ! dataRow[ "BarComponent" ] = transaction.EndOfDayDateTime.EndOfDaySpecificTime.ToString(); dataRow[ "TransactionType" ] = transaction.Type.ToString(); if ( transaction.Instrument != null ) *************** *** 144,148 **** dataRow[ "Price" ] = transaction.InstrumentPrice; dataRow[ "TransactionAmount" ] = transaction.InstrumentPrice * transaction.Quantity; ! addBalanceItems( transaction.ExtendedDateTime , dataRow ); detailedDataTable.Rows.Add( dataRow ); } --- 147,151 ---- dataRow[ "Price" ] = transaction.InstrumentPrice; dataRow[ "TransactionAmount" ] = transaction.InstrumentPrice * transaction.Quantity; ! addBalanceItems( transaction.EndOfDayDateTime , dataRow ); detailedDataTable.Rows.Add( dataRow ); } *************** *** 151,155 **** { if ( this.account.Transactions.ContainsKey( currentDateTime ) ) ! foreach ( TimedTransaction transaction in (ArrayList)this.account.Transactions[ currentDateTime ] ) { --- 154,158 ---- { if ( this.account.Transactions.ContainsKey( currentDateTime ) ) ! foreach ( EndOfDayTransaction transaction in (ArrayList)this.account.Transactions[ currentDateTime ] ) { *************** *** 163,167 **** DataRow dataRow = detailedDataTable.NewRow(); dataRow[ "DateTime" ] = currentDate; ! addBalanceItems( new ExtendedDateTime( currentDate , BarComponent.Close ) , dataRow ); detailedDataTable.Rows.Add( dataRow ); } --- 166,170 ---- DataRow dataRow = detailedDataTable.NewRow(); dataRow[ "DateTime" ] = currentDate; ! addBalanceItems( new EndOfDayDateTime( currentDate , EndOfDaySpecificTime.MarketClose ) , dataRow ); detailedDataTable.Rows.Add( dataRow ); } *************** *** 207,211 **** public AccountReport Create( string reportName , long numDaysForInterval , ! ExtendedDateTime endDateTime , string buyAndHoldTicker ) { this.reportName = reportName; --- 210,214 ---- public AccountReport Create( string reportName , long numDaysForInterval , ! EndOfDayDateTime endDateTime , string buyAndHoldTicker ) { this.reportName = reportName; *************** *** 224,228 **** public AccountReport Create( string reportName , long numDaysForInterval , ! ExtendedDateTime endDateTime ) { return Create( reportName , numDaysForInterval , endDateTime , "" ); --- 227,231 ---- public AccountReport Create( string reportName , long numDaysForInterval , ! EndOfDayDateTime endDateTime ) { return Create( reportName , numDaysForInterval , endDateTime , "" ); |