[Blotter-commits] r1106 - pkg/quantstrat/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 12 22:18:19 CEST 2012
Author: braverock
Date: 2012-07-12 22:18:19 +0200 (Thu, 12 Jul 2012)
New Revision: 1106
Modified:
pkg/quantstrat/R/parameters.R
Log:
- pass dots in applyParameter, into foreach, and to applyStrategy
Modified: pkg/quantstrat/R/parameters.R
===================================================================
--- pkg/quantstrat/R/parameters.R 2012-07-10 14:47:17 UTC (rev 1105)
+++ pkg/quantstrat/R/parameters.R 2012-07-12 20:18:19 UTC (rev 1106)
@@ -329,11 +329,12 @@
#' @param method Takes string 'expand' or 'random', specify how to generate samples of parameters. 'expand' will do all possible combinations of the parameter sets,
#' @param sampleSize Used when method=='random', specify how many parameter sets to generate and run test of.
#' @param verbose if verbose TRUE or 1+, will print a lot of debug info, default FALSE
+#' @param \dots any other passthru parameters
#' @seealso \code{\link{setParameterDistribution}}, \code{\link{setParameterConstraint}}
#'
#' @author Yu Chen
#' @export
-applyParameter<-function(strategy,portfolios,parameterPool,parameterConstraints,method,sampleSize,verbose=FALSE){
+applyParameter<-function(strategy,portfolios,parameterPool,parameterConstraints,method,sampleSize,verbose=FALSE,...){
#need to create combination of distribution values in each slot of the parameterPool
initialPortf<-getPortfolio(portfolios)
@@ -474,7 +475,7 @@
#Pack all symbols downloaded in .GlobalEnv
symbols<-names(.getSymbols)
- testPackListPRL<-foreach (i = 1:psize, .export=c('instruments',symbols,'getSymbols','blotter','tmp_strategy'),.verbose=TRUE) %dopar%
+ testPackListPRL<-foreach (i = 1:psize, .export=c('instruments',symbols,'getSymbols','blotter','tmp_strategy'),.verbose=TRUE,...=...) %dopar%
{
require(quantstrat, quietly=TRUE)
@@ -617,7 +618,7 @@
assign("PLtmp_strategy1",PLtmp_strategy,envir=as.environment(.strategy))
- testPack$out<-try(applyStrategy(strategy=PLtmp_strategy , portfolios=testPack$portfolio.st ))
+ testPack$out<-try(applyStrategy(strategy=PLtmp_strategy , portfolios=testPack$portfolio.st ),...=...)
testPack$strategy<-PLtmp_strategy
# Update portfolio ######################################################################################
More information about the Blotter-commits
mailing list