When I use enable.rule, I cannot override the rule inside enabled=FALSE.
For instance:
stratstocky <- add.rule(stratstocky,
name = "ruleSignal",
arguments = list(sigcol = "sdH",
sigval = TRUE,
replace = FALSE,
orderside = "long",
ordertype = "stoptrailing",
tmult = TRUE,
threshold = quote(stopLossPercent),
orderqty = "all",
orderset = "ocolong"),
type = "chain",
parent = "getLong",
label = "StopTrailingLong",
enabled = FALSE
)
When I put this code before applyStrategy:
enable.rule(stratstocky, type="chain", "StopTrail", enable=TRUE)
The rule will not be activated or active. The only way to activate a rule is to change its internal one TRUE. I tried accurate spelling, but it does not work for me.
This is not a big problem, because I can simply parameterize the internal inclusion of the rule and manage it this way, but would prefer to use the existing code to run my system.
Any understanding of the problems enable.rule?
source
share