Usage
walk.forward(strategy.st, paramset.label, portfolio.st, account.st, period, k.training, nsamples = 0, audit.prefix = NULL, k.testing, obj.func = function(x) { which(x == max(x)) }, obj.args = list(x = quote(tradeStats.list$Net.Trading.PL)), anchored = FALSE, include.insamples = TRUE, ..., verbose = FALSE)
Arguments
portfolio.st
the name of the portfolio object
account.st
the name of the account object
strategy.st
the name of the strategy object
paramset.label
a label uniquely identifying within
the strategy the paramset to be tested
period
the period unit, as a character string, eg.
'days' or 'months'
k.training
the number of periods to use for
training, eg. '3' months
nsamples
the number of sample param.combos to draw
from the paramset for training; 0 means all samples (see
also apply.paramset)
audit.prefix
prefix to generate filenames for
storage of audit data. For each training set, a separate
file is created, containing an enviroment called .audit,
with all in-sample portfolios and orderbooks as well as
information as to which param.combos were evaluated, and
the result of the objective function. In addition, a
special file is generated that contains portfolio and
orderbook for the concatenated testing param.combos as
selected by the objective function, plus (optionally)
complete in-sample portfolios and orderbooks for
reference (see include.insamples)
k.testing
the number of periods to use for
testing, eg. '1 month'
obj.func
a user provided function returning the
best param.combo from the paramset, based on training
results; defaults to 'max'
obj.args
a user provided argument to obj.func,
defaults to quote(tradeStats.list$Net.Trading.PL)
anchored
whether to use a fixed start for the
training window (TRUE), or a sliding start (FALSE);
defaults to FALSE
include.insamples
will optionally run a full
backtest for each param.combo in the paramset, and add
the resulting in-sample portfolios and orderbooks to the
file '.results.RData'; default TRUE ...
optional parameters to pass to
apply.paramset()
verbose
dumps a lot of info during the run if set
to TRUE, defaults to FALSE