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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 11 23:38:43 CET 2012


Author: opentrades
Date: 2012-11-11 23:38:43 +0100 (Sun, 11 Nov 2012)
New Revision: 1247

Modified:
   pkg/quantstrat/R/paramsets.R
Log:
added support for timespan paramsets



Modified: pkg/quantstrat/R/paramsets.R
===================================================================
--- pkg/quantstrat/R/paramsets.R	2012-11-11 19:47:45 UTC (rev 1246)
+++ pkg/quantstrat/R/paramsets.R	2012-11-11 22:38:43 UTC (rev 1247)
@@ -165,7 +165,8 @@
                 {
                     if(strategy[[components.type]][[index]]$label == component.label)
                     {
-                        strategy[[components.type]][[component.label]]$arguments[[variable.name]] <- param.combo[[param.label]]
+                        strategy[[components.type]][[index]]$arguments[[variable.name]] <- param.combo[[param.label]]
+
                         found <- TRUE
                         break
                     }
@@ -182,7 +183,11 @@
                 {
                     if(strategy$rules[[component.type]][[index]]$label == component.label)
                     {
-                        strategy$rules[[component.type]][[index]]$arguments[[variable.name]] <- param.combo[[param.label]]
+                        if(variable.name %in% c('timespan'))
+                            strategy$rules[[component.type]][[index]][[variable.name]] <- as.character(param.combo[[param.label]])
+                        else
+                            strategy$rules[[component.type]][[index]]$arguments[[variable.name]] <- param.combo[[param.label]]
+
                         found <- TRUE
                         break
                     }



More information about the Blotter-commits mailing list