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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 3 17:36:21 CEST 2012


Author: bodanker
Date: 2012-06-03 17:36:21 +0200 (Sun, 03 Jun 2012)
New Revision: 1038

Modified:
   pkg/blotter/R/updatePosPL.R
Log:
- correct check for valid prices in .updatePosPL (Prices -> prices)


Modified: pkg/blotter/R/updatePosPL.R
===================================================================
--- pkg/blotter/R/updatePosPL.R	2012-06-02 23:44:40 UTC (rev 1037)
+++ pkg/blotter/R/updatePosPL.R	2012-06-03 15:36:21 UTC (rev 1038)
@@ -27,11 +27,11 @@
     if(!is.null(dargs$symbol)) {symbol<-dargs$symbol} else symbol=NULL
     if(!is.null(dargs$prefer)) {prefer<-dargs$prefer} else prefer=NULL
     if(is.null(Prices)){
-		prices=getPrice(get(Symbol, pos=env), symbol=symbol, prefer=prefer)[,1]
-	} else {
+        prices=getPrice(get(Symbol, pos=env), symbol=symbol, prefer=prefer)[,1]
+    } else {
         prices=Prices
     }
-	if(.parseISO8601(Dates)$first.time <first(index(Prices))|| is.na(.parseISO8601(Dates)$first.time)){
+    if(.parseISO8601(Dates)$first.time < first(index(prices)) || is.na(.parseISO8601(Dates)$first.time)){
         Dates<-index(prices[paste('/',.parseISO8601(Dates)$last.time,sep='')])
     }
     



More information about the Blotter-commits mailing list