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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Nov 1 14:04:23 CET 2010


Author: llevenson
Date: 2010-11-01 14:04:23 +0100 (Mon, 01 Nov 2010)
New Revision: 435

Modified:
   pkg/quantstrat/R/strategy.R
Log:
- Added verbose field to give user ability to view output or not.

Modified: pkg/quantstrat/R/strategy.R
===================================================================
--- pkg/quantstrat/R/strategy.R	2010-10-28 16:41:12 UTC (rev 434)
+++ pkg/quantstrat/R/strategy.R	2010-11-01 13:04:23 UTC (rev 435)
@@ -65,8 +65,9 @@
 #' @param mktdata an xts object containing market data.  depending on indicators, may need to be in OHLCV or BBO formats, default NULL
 #' @param parameters named list of parameters to be applied during evaluation of the strategy, default NULL
 #' @param ... any other passthru parameters
+#' @param verbose if TRUE, return output list
 #' @export
-applyStrategy <- function(strategy , portfolios, mktdata=NULL , parameters=NULL, ... ) {
+applyStrategy <- function(strategy , portfolios, mktdata=NULL , parameters=NULL, ..., verbose=TRUE ) {
     #TODO add Date subsetting
     #TODO add saving of modified market data
     
@@ -123,7 +124,7 @@
 		}
 	}
     
-    return(ret)
+    if(verbose) return(ret)
 }
 
 #' test to see if object is of type 'strategy'



More information about the Blotter-commits mailing list