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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 8 16:36:00 CET 2012


Author: braverock
Date: 2012-11-08 16:36:00 +0100 (Thu, 08 Nov 2012)
New Revision: 1240

Modified:
   pkg/quantstrat/R/indicators.R
Log:
- pass un-matching arguments, assuming the user knows what they're doing, still warn.

Modified: pkg/quantstrat/R/indicators.R
===================================================================
--- pkg/quantstrat/R/indicators.R	2012-11-05 21:24:09 UTC (rev 1239)
+++ pkg/quantstrat/R/indicators.R	2012-11-08 15:36:00 UTC (rev 1240)
@@ -169,11 +169,13 @@
         onames <- names(.formals)
         
         pm <- pmatch(names(indicator$arguments), onames, nomatch = 0L)
-        if (any(pm == 0L))
-            warning(paste("some arguments stored for",indicator$name,"do not match"))
         names(indicator$arguments[pm > 0L]) <- onames[pm]
         .formals[pm] <- indicator$arguments[pm > 0L]
-		
+        if (any(pm == 0L)){
+            warning(paste("some arguments stored for",indicator$name,"do not match"))
+            .formals<-c(.formals,indicator$arguments[pm==0L])
+        }
+        
 		# now add arguments from parameters
 		if(length(parameters)){
 			pm <- pmatch(names(parameters), onames, nomatch = 0L)



More information about the Blotter-commits mailing list