[Blotter-commits] r215 - pkg/blotter/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 28 23:29:43 CET 2010


Author: braverock
Date: 2010-01-28 23:29:43 +0100 (Thu, 28 Jan 2010)
New Revision: 215

Modified:
   pkg/blotter/R/calcAcctAttr.R
   pkg/blotter/R/updateAcct.R
Log:
- additions to improve NA handling in irregular series

Modified: pkg/blotter/R/calcAcctAttr.R
===================================================================
--- pkg/blotter/R/calcAcctAttr.R	2010-01-28 22:19:27 UTC (rev 214)
+++ pkg/blotter/R/calcAcctAttr.R	2010-01-28 22:29:43 UTC (rev 215)
@@ -17,7 +17,7 @@
 #        Dates = time(Account[[2]][Dates])
     
     table = .getByPortf(Account, Attribute, Dates)
-    result = xts(rowSums(table),order.by=index(table),na.rm=TRUE)
+    result = xts(rowSums(table,na.rm=TRUE),order.by=index(table))
     colnames(result) = Attribute
     return(result)
 }

Modified: pkg/blotter/R/updateAcct.R
===================================================================
--- pkg/blotter/R/updateAcct.R	2010-01-28 22:19:27 UTC (rev 214)
+++ pkg/blotter/R/updateAcct.R	2010-01-28 22:29:43 UTC (rev 215)
@@ -65,7 +65,6 @@
         UnrealizedPL = calcAcctAttr(Account, 'Unrealized.PL', CurrentSpan)
         TradingPL = calcAcctAttr(Account, 'Trading.PL', CurrentSpan)
         rows = cbind(Additions, Withdrawals, TxnFees, RealizedPL, UnrealizedPL, IntIncome, TradingPL, AdvisoryFees,NetPerformance, EndEq)
-        browser()
         colnames(rows) = c('Additions', 'Withdrawals', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', 'Int.Income', 'Trading.PL', 'Advisory.Fees', 'Net.Performance', 'End.Eq')
         Account[['TOTAL']] <- rbind(Account[['TOTAL']], rows)
     # This function does not calculate End.Eq 



More information about the Blotter-commits mailing list