[Blotter-commits] r1382 - in pkg/quantstrat: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 24 01:56:18 CET 2013


Author: opentrades
Date: 2013-01-24 01:56:18 +0100 (Thu, 24 Jan 2013)
New Revision: 1382

Modified:
   pkg/quantstrat/NAMESPACE
   pkg/quantstrat/R/paramsets.R
   pkg/quantstrat/man/apply.paramset.Rd
Log:
- added packages parameter to apply.paramsets() to allow user to specify extra packages to load



Modified: pkg/quantstrat/NAMESPACE
===================================================================
--- pkg/quantstrat/NAMESPACE	2013-01-23 17:23:02 UTC (rev 1381)
+++ pkg/quantstrat/NAMESPACE	2013-01-24 00:56:18 UTC (rev 1382)
@@ -11,8 +11,8 @@
 export(applyParameter)
 export(applyRules)
 export(applySignals)
+export(applyStrategy.rebalancing)
 export(applyStrategy)
-export(applyStrategy.rebalancing)
 export(delete.paramset)
 export(getOrderBook)
 export(getOrders)

Modified: pkg/quantstrat/R/paramsets.R
===================================================================
--- pkg/quantstrat/R/paramsets.R	2013-01-23 17:23:02 UTC (rev 1381)
+++ pkg/quantstrat/R/paramsets.R	2013-01-24 00:56:18 UTC (rev 1382)
@@ -349,6 +349,7 @@
 #' @param user.func an optional user-supplied function to be run for each param.combo at the end, either on the slave or on the master (see calc)
 #' @param user.args user-supplied list of arguments for user.func
 #' @param calc 'slave' to run updatePortfolio() and tradesStats() on the slave and return all portfolios and orderbooks as a list: higher parallelization but more data transfer between master and slave; 'master' to have updatePortf() and tradeStats() run at the master and return all portfolios and orderbooks in the .blotter and .strategy environments resp: less parallelization but also less data transfer between slave and master; default is 'slave'
+#' @param packages a vector specifying names of R packages to be loaded by the slave, default NULL
 #' @param audit a user-specified environment to store a copy of all portfolios, orderbooks and other data from the tests, or NULL to trash this information
 #' @param verbose return full information, in particular the .blotter environment, default FALSE
 #'
@@ -356,7 +357,7 @@
 #' @export
 #' @seealso \code{\link{add.constraint}}, \code{\link{add.constraint}}, \code{\link{delete.paramset}}
 
-apply.paramset <- function(strategy.st, paramset.label, portfolio.st, account.st, mktdata=NULL, nsamples=0, user.func=NULL, user.args=NULL, calc='slave', audit=NULL, verbose=FALSE)
+apply.paramset <- function(strategy.st, paramset.label, portfolio.st, account.st, mktdata=NULL, nsamples=0, user.func=NULL, user.args=NULL, calc='slave', audit=NULL, packages=NULL, verbose=FALSE)
 {
     must.have.args(match.call(), c('strategy.st', 'paramset.label', 'portfolio.st'))
 
@@ -428,7 +429,7 @@
 
     results <- foreach(param.combo=iter(param.combos,by='row'),
         .verbose=verbose, .errorhandling='pass',
-        .packages='quantstrat',
+        .packages=c('quantstrat', packages),
         .combine=combine, .multicombine=TRUE, .maxcombine=nrow(param.combos),
         .export=c(env.functions, 'env.instrument')) %dopar%
     {

Modified: pkg/quantstrat/man/apply.paramset.Rd
===================================================================
--- pkg/quantstrat/man/apply.paramset.Rd	2013-01-23 17:23:02 UTC (rev 1381)
+++ pkg/quantstrat/man/apply.paramset.Rd	2013-01-24 00:56:18 UTC (rev 1382)
@@ -5,7 +5,7 @@
   apply.paramset(strategy.st, paramset.label, portfolio.st,
     account.st, mktdata = NULL, nsamples = 0,
     user.func = NULL, user.args = NULL, calc = "slave",
-    audit = NULL, verbose = FALSE)
+    audit = NULL, packages = NULL, verbose = FALSE)
 }
 \arguments{
   \item{strategy.st}{the name of the strategy object}
@@ -40,6 +40,9 @@
   also less data transfer between slave and master; default
   is 'slave'}
 
+  \item{packages}{a vector specifying names of R packages
+  to be loaded by the slave, default NULL}
+
   \item{audit}{a user-specified environment to store a copy
   of all portfolios, orderbooks and other data from the
   tests, or NULL to trash this information}



More information about the Blotter-commits mailing list