[Blotter-commits] r620 - pkg/quantstrat/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 10 01:15:15 CEST 2011


Author: gsee
Date: 2011-06-10 01:15:14 +0200 (Fri, 10 Jun 2011)
New Revision: 620

Modified:
   pkg/quantstrat/R/rules.R
   pkg/quantstrat/R/signals.R
   pkg/quantstrat/R/strategy.R
Log:
suppress unnecessary warnings + patch to avoid warning in rules.R

Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2011-06-09 23:12:43 UTC (rev 619)
+++ pkg/quantstrat/R/rules.R	2011-06-09 23:15:14 UTC (rev 620)
@@ -493,7 +493,9 @@
             dindex<-get.dindex()
         } else {
             dindex<-get.dindex()
-            curIndex<-min(dindex[dindex>curIndex]) 
+            if (any(dindex > curIndex)) {
+                curIndex<-min(dindex[dindex>curIndex]) 
+            } else curIndex <- FALSE
         }
         if (is.na(curIndex) || curIndex >= length(index(mktdata))) curIndex=FALSE
         

Modified: pkg/quantstrat/R/signals.R
===================================================================
--- pkg/quantstrat/R/signals.R	2011-06-09 23:12:43 UTC (rev 619)
+++ pkg/quantstrat/R/signals.R	2011-06-09 23:15:14 UTC (rev 620)
@@ -192,7 +192,7 @@
     ret_sig = FALSE
     lng<-length(columns)
     for (i in 1:(lng-1)) {
-        ret_sig = ret_sig | diff(sigComparison(label=label,data=data,columns=columns[c(i,lng)],relationship=relationship))==1
+        ret_sig = suppressWarnings(ret_sig | diff(sigComparison(label=label,data=data,columns=columns[c(i,lng)],relationship=relationship))==1)
     }
     is.na(ret_sig) <- which(!ret_sig)
     colnames(ret_sig)<-label

Modified: pkg/quantstrat/R/strategy.R
===================================================================
--- pkg/quantstrat/R/strategy.R	2011-06-09 23:12:43 UTC (rev 619)
+++ pkg/quantstrat/R/strategy.R	2011-06-09 23:15:14 UTC (rev 620)
@@ -116,7 +116,7 @@
             sret$rules$nonpath<-applyRules(portfolio=portfolio, symbol=symbol, strategy=strategy, mktdata=mktdata, Dates=NULL, indicators=sret$indicators, signals=sret$signals, parameters=parameters,  ..., path.dep=FALSE)
 			
 			## Check for open orders
-			rem.orders <- getOrders(portfolio=portfolio, symbol=symbol, status="open") #, timespan=timespan, ordertype=ordertype,which.i=TRUE)
+			rem.orders <- suppressWarnings(getOrders(portfolio=portfolio, symbol=symbol, status="open")) #, timespan=timespan, ordertype=ordertype,which.i=TRUE)
 			if(nrow(rem.orders)>0){pd <- TRUE}
             if(pd==TRUE){sret$rules$pathdep<-applyRules(portfolio=portfolio, symbol=symbol, strategy=strategy, mktdata=mktdata, Dates=NULL, indicators=sret$indicators, signals=sret$signals, parameters=parameters,  ..., path.dep=TRUE)}
 



More information about the Blotter-commits mailing list