[Blotter-commits] r1548 - in pkg/quantstrat: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Oct 24 11:30:52 CEST 2013
Author: bodanker
Date: 2013-10-24 11:30:51 +0200 (Thu, 24 Oct 2013)
New Revision: 1548
Modified:
pkg/quantstrat/R/paramsets.R
pkg/quantstrat/man/apply.paramset.Rd
Log:
- add '...' to apply.paramset, and pass to applyStrategy and updatePortf
Modified: pkg/quantstrat/R/paramsets.R
===================================================================
--- pkg/quantstrat/R/paramsets.R 2013-10-22 15:01:19 UTC (rev 1547)
+++ pkg/quantstrat/R/paramsets.R 2013-10-24 09:30:51 UTC (rev 1548)
@@ -352,12 +352,13 @@
#' @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
+#' @param ... any other passthru parameters
#'
#' @author Jan Humme
#' @export
#' @seealso \code{\link{add.distribution.constraint}}, \code{\link{add.distribution.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, packages=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'))
@@ -375,6 +376,7 @@
param.combos <- expand.distributions(distributions)
param.combos <- apply.constraints(constraints, distributions, param.combos)
+ rownames(param.combos) <- NULL # reset rownames
if(nsamples > 0)
param.combos <- select.samples(nsamples, param.combos)
@@ -473,7 +475,7 @@
}
strategy <- install.param.combo(strategy, param.combo, paramset.label)
- applyStrategy(strategy, portfolios=result$portfolio.st, mktdata=mktdata, verbose=verbose)
+ applyStrategy(strategy, portfolios=result$portfolio.st, mktdata=mktdata, verbose=verbose, ...)
if(exists('redisContext'))
{
@@ -487,7 +489,7 @@
if(calc == 'slave')
{
- updatePortf(result$portfolio.st, Dates=paste('::',as.Date(Sys.time()),sep=''), Prices=mktdata)
+ updatePortf(result$portfolio.st, Dates=paste('::',as.Date(Sys.time()),sep=''), Prices=mktdata, ...)
result$tradeStats <- tradeStats(result$portfolio.st)
if(!is.null(user.func) && !is.null(user.args))
Modified: pkg/quantstrat/man/apply.paramset.Rd
===================================================================
--- pkg/quantstrat/man/apply.paramset.Rd 2013-10-22 15:01:19 UTC (rev 1547)
+++ pkg/quantstrat/man/apply.paramset.Rd 2013-10-24 09:30:51 UTC (rev 1548)
@@ -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, packages = NULL, verbose = FALSE)
+ audit = NULL, packages = NULL, verbose = FALSE, ...)
}
\arguments{
\item{strategy.st}{the name of the strategy object}
@@ -49,6 +49,8 @@
\item{verbose}{return full information, in particular the
.blotter environment, default FALSE}
+
+ \item{...}{any other passthru parameters}
}
\description{
This function will run applyStrategy() on portfolio.st,
More information about the Blotter-commits
mailing list