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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 4 16:20:53 CET 2010


Author: braverock
Date: 2010-02-04 16:20:53 +0100 (Thu, 04 Feb 2010)
New Revision: 225

Modified:
   pkg/quantstrat/R/indicators.R
   pkg/quantstrat/R/signals.R
Log:
- applying patch modified from Josh Ulrich to handle dots correctly for functions that can't accept them.

Modified: pkg/quantstrat/R/indicators.R
===================================================================
--- pkg/quantstrat/R/indicators.R	2010-02-03 21:32:54 UTC (rev 224)
+++ pkg/quantstrat/R/indicators.R	2010-02-04 15:20:53 UTC (rev 225)
@@ -66,15 +66,14 @@
             warning(paste("some arguments stored for",indicator$name,"do not match"))
         names(indicator$arguments[pm > 0L]) <- onames[pm]
         .formals[pm] <- indicator$arguments[pm > 0L]
-        #now add dots
+        #now add arguments from dots
         if (length(nargs)) {
             pm <- pmatch(names(nargs), onames, nomatch = 0L)
             names(nargs[pm > 0L]) <- onames[pm]
             .formals[pm] <- nargs[pm > 0L]
         }
-        #.formals$... <- ''
+        .formals$... <- NULL
         
-        formals(fun) <- .formals
         tmp_val<-do.call(fun,.formals)
         if(is.null(names(tmp_val)) & ncol(tmp_val)==1) names(tmp_val)<-indicator$label
         if (nrow(mktdata)==nrow(tmp_val) | length(mktdata)==length(tmp_val)) {

Modified: pkg/quantstrat/R/signals.R
===================================================================
--- pkg/quantstrat/R/signals.R	2010-02-03 21:32:54 UTC (rev 224)
+++ pkg/quantstrat/R/signals.R	2010-02-04 15:20:53 UTC (rev 225)
@@ -48,7 +48,7 @@
     nargs <-list(...)
     if(length(nargs)==0) nargs=NULL
     if (length('...')==0 | is.null('...')) {
-        #rm('...')
+        rm('...')
         nargs=NULL
     }
     
@@ -78,7 +78,6 @@
         }
         .formals$... <- NULL
         
-        formals(fun) <- .formals
         tmp_val<-do.call(fun,.formals)
         if(is.null(names(tmp_val)) & ncol(tmp_val)==1) names(tmp_val)<-signal$label
         if (nrow(mktdata)==nrow(tmp_val) | length(mktdata)==length(tmp_val)) {



More information about the Blotter-commits mailing list