[Blotter-commits] r161 - pkg/blotter/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 15 21:23:52 CET 2010
Author: braverock
Date: 2010-01-15 21:23:51 +0100 (Fri, 15 Jan 2010)
New Revision: 161
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 03:50:54 UTC (rev 160)
+++ pkg/blotter/R/addTxn.R 2010-01-15 20:23:51 UTC (rev 161)
@@ -97,9 +97,9 @@
#PrevPosQty <- getPosQty(pname, Symbol, index(TxnData[row,]))
PosQty <- PrevPosQty+TxnQty
PosAvgCost <- calcPosAvgCost(PrevPosQty, PrevPosAvgCost, TxnValue, PosQty) # 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