quantstrat (version 0.8.2)

enable.rule: enable a rule in the strategy

Description

function to make it easy to enable (or disable) a specific rule in a strategy

Usage

enable.rule(strategy, type = c(NULL, "risk", "order", "rebalance", "exit", "enter", "chain"), label, enabled = TRUE, store = FALSE)

Arguments

strategy
an object of type 'strategy' which contains the rule
type
one of "risk","order","rebalance","exit","enter","chain"
label
the label for the rule; grep will be used to match, so multiple rules may be enabled (disabled) as a result
enabled
TRUE/FALSE whether the rule is enabled for use in applying the strategy, default TRUE
store
TRUE/FALSE whether to store the updated strategy in the .strategy environment, or return it. default FALSE

See Also

add.rule applyStrategy