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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 20 13:52:09 CET 2010


Author: braverock
Date: 2010-12-20 13:52:08 +0100 (Mon, 20 Dec 2010)
New Revision: 502

Modified:
   pkg/blotter/R/updatePosPL.R
Log:
- fix Prices/prices mixup reported by  Aleksandr Rudnev < alex <dot> rudnev<at> gmail <dot> com > and Lei Jin < leijin56 <at> gmail <dot> com >

Modified: pkg/blotter/R/updatePosPL.R
===================================================================
--- pkg/blotter/R/updatePosPL.R	2010-12-15 21:27:22 UTC (rev 501)
+++ pkg/blotter/R/updatePosPL.R	2010-12-20 12:52:08 UTC (rev 502)
@@ -32,7 +32,7 @@
             Dates = time(prices)
 	} else if(!is.timeBased(Dates)) Dates = time(prices[Dates])
     
-    if(ncol(Prices)>1) Prices=getPrice(Prices,Symbol)
+    if(ncol(prices)>1) prices=getPrice(Prices,Symbol)
     
 
 	# line up Prices dates with Dates set/index/span passed in.
@@ -43,8 +43,6 @@
 	
 	#subset Prices by dateRange too...
 	Prices<-prices[dateRange]
-	
-	if(ncol(Prices)>1) Prices=getPrice(prices,Symbol)[dateRange] 
     
     if(nrow(Prices)<1) {
         Prices=xts(cbind(Prices=as.numeric(last(prices[paste('::',endDate,sep='')]))),as.Date(endDate))



More information about the Blotter-commits mailing list