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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 23 16:20:48 CET 2010


Author: braverock
Date: 2010-02-23 16:20:48 +0100 (Tue, 23 Feb 2010)
New Revision: 250

Modified:
   pkg/quantstrat/R/rules.R
Log:
- add pricemethod and order sizing implementation code to ruleSignal

Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2010-02-23 12:34:08 UTC (rev 249)
+++ pkg/quantstrat/R/rules.R	2010-02-23 15:20:48 UTC (rev 250)
@@ -37,7 +37,7 @@
 #' @param strategy an object of type 'strategy' to add the rule to
 #' @param name name of the rule, must correspond to an R function
 #' @param arguments default arguments to be passed to an rule function when executed
-#' @param label arbitrary text label for signal output, NULL default will be converted to '<name>.sig'
+#' @param label arbitrary text label for rule output, NULL default will be converted to '<name>.rule'
 #' @param type one of "risk","order","rebalance","exit","entry", see Details
 #' @param ... any other passthru parameters
 #' @param enabled TRUE/FALSE whether the rule is enabled for use in applying the strategy, default TRUE
@@ -54,7 +54,8 @@
     tmp_rule$type<-type
     tmp_rule$enabled<-enabled
     if (!is.list(arguments)) stop("arguments must be passed as a named list")
-    arguments$label=label
+    if(is.null(label)) label = paste(name,"rule",sep='.')
+    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



More information about the Blotter-commits mailing list