[Blotter-commits] r1605 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Apr 27 07:27:17 CEST 2014
Author: bodanker
Date: 2014-04-27 07:26:52 +0200 (Sun, 27 Apr 2014)
New Revision: 1605
Modified:
pkg/blotter/R/addTxn.R
Log:
- Fixes to addTxns
Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R 2014-04-25 12:57:49 UTC (rev 1604)
+++ pkg/blotter/R/addTxn.R 2014-04-27 05:26:52 UTC (rev 1605)
@@ -173,7 +173,7 @@
# initialize new transaction object
NewTxns <- xts(matrix(NA_real_, nrow(TxnData), 10L), index(TxnData))
colnames(NewTxns) <- c('Txn.Qty', 'Txn.Price', 'Txn.Value', 'Txn.Avg.Cost', 'Pos.Qty', 'Pos.Avg.Cost', 'Gross.Txn.Realized.PL', 'Txn.Fees', 'Net.Txn.Realized.PL', 'Con.Mult')
-1
+
if(!("TxnQty" %in% colnames(TxnData))) {
warning(paste("No TxnQty column found, what did you call it?"))
} else {
@@ -182,10 +182,8 @@
if(!("TxnPrice" %in% colnames(TxnData))) {
warning(paste("No TxnPrice column found, what did you call it?"))
} else {
- NewTxns$Txn.Qty <- as.numeric(TxnData$TxnPrice)
+ NewTxns$Txn.Price <- as.numeric(TxnData$TxnPrice)
}
- #NewTxns$Txn.Qty <- as.numeric(TxnData$TxnQty)
- #NewTxns$Txn.Price <- as.numeric(TxnData$TxnPrice)
if("TxnFees" %in% colnames(TxnData)) {
NewTxns$Txn.Fees <- as.numeric(TxnData$TxnFees)
} else {
More information about the Blotter-commits
mailing list