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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 12 17:35:01 CET 2010


Author: braverock
Date: 2010-01-12 17:35:01 +0100 (Tue, 12 Jan 2010)
New Revision: 140

Modified:
   pkg/blotter/R/updatePosPL.R
Log:
- add Ccy.Mult

Modified: pkg/blotter/R/updatePosPL.R
===================================================================
--- pkg/blotter/R/updatePosPL.R	2010-01-12 16:05:41 UTC (rev 139)
+++ pkg/blotter/R/updatePosPL.R	2010-01-12 16:35:01 UTC (rev 140)
@@ -36,7 +36,9 @@
 
         ConMult = 1 ## @TODO: Change this to look up the value from instrument
         PrevConMult = 1 ## @TODO: Change this to look up the value from instrument?
-
+        CcyMult =1 ## @TODO: Change this to look up the value from instrument?
+        PrevCcyMult =1 ## @TODO: Change this to look up the value from instrument?
+        
         TxnValue = getTxnValue(pname, Symbol, CurrentDate)
         TxnFees = getTxnFees(pname, Symbol, CurrentDate)
         PosQty = getPosQty(pname, Symbol, CurrentDate)
@@ -58,8 +60,8 @@
         RealizedPL = getRealizedPL(pname, Symbol, CurrentDate)
         UnrealizedPL = TradingPL - RealizedPL # TODO: calcUnrealizedPL(TradingPL, RealizedPL)
 
-        NewPeriod = as.xts(t(c(PosQty, ConMult, PosValue, TxnValue, TxnFees, RealizedPL, UnrealizedPL, TradingPL)), order.by=as.POSIXct(CurrentDate))
-        colnames(NewPeriod) = c('Pos.Qty', 'Con.Mult', 'Pos.Value', 'Txn.Value', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', 'Trading.PL')
+        NewPeriod = as.xts(t(c(PosQty, ConMult, CcyMult, PosValue, TxnValue, TxnFees, RealizedPL, UnrealizedPL, TradingPL)), order.by=as.POSIXct(CurrentDate))
+        colnames(NewPeriod) = c('Pos.Qty', 'Con.Mult', 'Ccy.Mult', 'Pos.Value', 'Txn.Value', 'Txn.Fees', 'Realized.PL', 'Unrealized.PL', 'Trading.PL')
         Portfolio[[Symbol]]$posPL <- rbind(Portfolio[[Symbol]]$posPL, NewPeriod) 
     }
     # return(Portfolio)



More information about the Blotter-commits mailing list