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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 23 23:43:29 CET 2010


Author: braverock
Date: 2010-02-23 23:43:29 +0100 (Tue, 23 Feb 2010)
New Revision: 254

Modified:
   pkg/quantstrat/R/rules.R
Log:
- fix add.rule code to put things in the strategy container properly

Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2010-02-23 22:42:47 UTC (rev 253)
+++ pkg/quantstrat/R/rules.R	2010-02-23 22:43:29 UTC (rev 254)
@@ -58,9 +58,10 @@
     tmp_rule$label<-label
     tmp_rule$arguments<-arguments
     tmp_rule$path.dep<-path.dep
-    if(!hasArg(indexnum) | (hasArg(indexnum) & is.null(indexnum))) indexnum = length(strategy$rules[type])+1
     tmp_rule$call<-match.call()
-    strategy$rules[type][[indexnum]]<-tmp_rule
+    class(tmp_rule)<-'trade_rule'
+    if(!hasArg(indexnum) | (hasArg(indexnum) & is.null(indexnum))) indexnum = length(strategy$rules[[type]])+1
+    strategy$rules[[type]][[indexnum]]<-tmp_rule
     
     if (store) assign(strategy$name,strategy,envir=as.environment(.strategy))
     else return(strategy)



More information about the Blotter-commits mailing list