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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 24 14:48:32 CET 2013


Author: opentrades
Date: 2013-02-24 14:48:31 +0100 (Sun, 24 Feb 2013)
New Revision: 1402

Modified:
   pkg/quantstrat/R/indicators.R
   pkg/quantstrat/R/signals.R
Log:
- applyIndicators() and applySignals() now force label names if provided in add.indicator() and add.signal()



Modified: pkg/quantstrat/R/indicators.R
===================================================================
--- pkg/quantstrat/R/indicators.R	2013-02-21 18:40:59 UTC (rev 1401)
+++ pkg/quantstrat/R/indicators.R	2013-02-24 13:48:31 UTC (rev 1402)
@@ -192,7 +192,7 @@
         .formals$... <- NULL
         
         tmp_val<-do.call(fun,.formals)
-        if(is.null(colnames(tmp_val))) {
+        if(is.null(colnames(tmp_val)) || !is.null(indicator$label)) {
             if (ncol(tmp_val)==1) { #no names, only one column
                 colnames(tmp_val)<-indicator$label 
             } else { #no names, more than one column

Modified: pkg/quantstrat/R/signals.R
===================================================================
--- pkg/quantstrat/R/signals.R	2013-02-21 18:40:59 UTC (rev 1401)
+++ pkg/quantstrat/R/signals.R	2013-02-24 13:48:31 UTC (rev 1402)
@@ -133,7 +133,7 @@
         .formals$... <- NULL
         
         tmp_val<-do.call(fun,.formals)
-        if(is.null(colnames(tmp_val))) {
+        if(is.null(colnames(tmp_val)) || !is.null(signal$label)) {
             if (ncol(tmp_val)==1) { #no names, only one column
                 colnames(tmp_val)<-signal$label 
             } else { #no names, more than one column



More information about the Blotter-commits mailing list