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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 15 22:57:31 CET 2010


Author: peter_carl
Date: 2010-01-15 22:57:31 +0100 (Fri, 15 Jan 2010)
New Revision: 167

Modified:
   pkg/blotter/R/updatePosPL.R
Log:
- fixed query to PrevPosQty


Modified: pkg/blotter/R/updatePosPL.R
===================================================================
--- pkg/blotter/R/updatePosPL.R	2010-01-15 21:46:12 UTC (rev 166)
+++ pkg/blotter/R/updatePosPL.R	2010-01-15 21:57:31 UTC (rev 167)
@@ -69,7 +69,7 @@
         #TODO write a single getTxn and use the values instead of these lines
         TxnValue = getTxnValue(pname, Symbol, CurrentSpan)
         TxnFees = getTxnFees(pname, Symbol, CurrentSpan)
-        PosQty = getPosQty(pname, Symbol, CurrentSpan)
+        PosQty = getPosQty(pname, Symbol, CurrentDate)
         
         ClosePrice = as.numeric(last(Prices[CurrentDate, grep("Close", colnames(Prices))])) #not necessary
         PosValue = calcPosValue(PosQty, ClosePrice, ConMult)
@@ -77,7 +77,7 @@
         if(is.na(PrevDate))
             PrevPosQty = 0
         else
-            PrevPosQty = getPosQty(pname, Symbol, PrevSpan) 
+            PrevPosQty = getPosQty(pname, Symbol, PrevDate) 
 
         if(PrevPosQty==0)
             PrevClosePrice = 0



More information about the Blotter-commits mailing list