initStrategy
will run a series of common
initialization functions at the beginning of an
applyStrategy
call. This function allows the
user to add arbitrary initialization functions to the
sequence.
add.init(strategy, name, arguments, parameters = NULL, label = NULL, ..., enabled = TRUE, indexnum = NULL, store = FALSE)
strategy
was the name of a strategy, the name. It
it was a strategy, the updated strategy.
init
slot of the strategy object and when applyStrategy
is evaluated, the arbitrary initialization functions will
be evaluated after the standardized functions.For example, if your strategy uses a synthetic basket instrument, you could use this initialization slot to add a custom constructor to build the basket instrument time series and modify the symbols slot(s) of the strategy and portfolio.