[Blotter-commits] r165 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 15 22:39:06 CET 2010
Author: braverock
Date: 2010-01-15 22:39:05 +0100 (Fri, 15 Jan 2010)
New Revision: 165
Modified:
pkg/blotter/R/addTxn.R
Log:
- fix Realized.PL in addTxns
Modified: pkg/blotter/R/addTxn.R
===================================================================
--- pkg/blotter/R/addTxn.R 2010-01-15 21:32:35 UTC (rev 164)
+++ pkg/blotter/R/addTxn.R 2010-01-15 21:39:05 UTC (rev 165)
@@ -97,9 +97,9 @@
#PrevPosQty <- getPosQty(pname, Symbol, index(TxnData[row,]))
PosQty <- PrevPosQty+TxnQty
PosAvgCost <- calcPosAvgCost(PrevPosQty, PrevPosAvgCost, TxnValue, PosQty, ConMult) # lag this over the data?
+ RealizedPL = calcRealizedPL(TxnQty, TxnAvgCost, PrevPosAvgCost, PosQty, PrevPosQty, ConMult)
PrevPosQty <- PosQty
PrevPosAvgCost <- PosAvgCost
- RealizedPL = calcRealizedPL(TxnQty, TxnAvgCost, PrevPosAvgCost, PosQty, PrevPosQty, ConMult)
NewTxn = xts(t(c(TxnQty,
TxnPrice,
More information about the Blotter-commits
mailing list