Description Usage Arguments Details See Also
This function is the wrapper that holds together the execution of a strategy.
1 2 3 |
strategy |
an object of type 'strategy' to add the indicator to |
portfolios |
a list of portfolios to apply the strategy to |
mktdata |
an xts object containing market data. depending on indicators, may need to be in OHLCV or BBO formats, default NULL |
parameters |
named list of parameters to be applied during evaluation of the strategy, default NULL |
... |
any other passthru parameters |
debug |
if TRUE, return output list |
symbols |
character vector identifying symbols to initialize a portfolio for, default NULL |
initStrat |
whether to use (experimental) initialization code, default FALSE |
updateStrat |
whether to use (experimental) wrapup code, default FALSE |
initBySymbol |
whether to load and initialize each instrument within the |
gc |
if TRUE, call |
delorders |
if TRUE, delete the order book for a symbol at the end of the symbols loop, will cause issues with rebalancing, default FALSE (experimental) |
After the straetgy object has been created, it may be applied to any combination of symbols and parameters.
The symbols to be utilized will be defined in one of two ways, either by
specifying a name of a portfolio that has already been initialized
with the portfolios
argument, or be specifying a
symbols
argument in addition to setting initStrat=TRUE
.
applyStrategy
will use the R core function get
to load market data for each symbol during stategy evaluation unless
the user passes mktdata
in the call to applyStrategy
strategy
, applyIndicators
,
applySignals
, applyRules
,
initStrategy
,
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.