[Blotter-commits] r143 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jan 12 18:22:27 CET 2010
Author: braverock
Date: 2010-01-12 18:22:27 +0100 (Tue, 12 Jan 2010)
New Revision: 143
Modified:
pkg/blotter/R/addTxn.R
Log:
- add assignment operator (back) to rbind in addTxn() fn
Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R 2010-01-12 16:49:53 UTC (rev 142)
+++ pkg/blotter/R/addTxn.R 2010-01-12 17:22:27 UTC (rev 143)
@@ -41,10 +41,11 @@
# Store the transaction and calculations
NewTxn = xts(t(c(TxnQty, TxnPrice, txnfees, TxnValue, TxnAvgCost, PosQty, PosAvgCost, RealizedPL)), order.by=as.POSIXct(TxnDate))
#colnames(NewTxn) = c('Txn.Qty', 'Txn.Price', 'Txn.Fees', 'Txn.Value', 'Txn.Avg.Cost', 'Pos.Qty', 'Pos.Avg.Cost', 'Realized.PL')
- rbind(Portfolio[[Symbol]]$txn, NewTxn)
+ Portfolio[[Symbol]]$txn<-rbind(Portfolio[[Symbol]]$txn, NewTxn)
if(verbose)
print(paste(TxnDate, Symbol, TxnQty, "@",TxnPrice, sep=" "))
+ #print(Portfolio[[Symbol]]$txn)
assign(paste("portfolio",pname,sep='.'),Portfolio,envir=.blotter)
}
More information about the Blotter-commits
mailing list