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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 15 22:46:13 CET 2010


Author: peter_carl
Date: 2010-01-15 22:46:12 +0100 (Fri, 15 Jan 2010)
New Revision: 166

Modified:
   pkg/blotter/R/calcPosAvgCost.R
Log:
- fixed ConMult math


Modified: pkg/blotter/R/calcPosAvgCost.R
===================================================================
--- pkg/blotter/R/calcPosAvgCost.R	2010-01-15 21:39:05 UTC (rev 165)
+++ pkg/blotter/R/calcPosAvgCost.R	2010-01-15 21:46:12 UTC (rev 166)
@@ -18,7 +18,7 @@
     if(PosQty == 0)
         PosAvgCost = 0
     else {
-        PosAvgCost = (PrevPosQty * PrevPosAvgCost + TxnValue)/(PosQty*ConMult)
+        PosAvgCost = (PrevPosQty * PrevPosAvgCost * ConMult + TxnValue)/(PosQty*ConMult)
     }
     return(PosAvgCost)
 }



More information about the Blotter-commits mailing list