When I use enable.rule
I cannot override the rule's internal enabled=FALSE
.
For example:
## Stop Loss Rule
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 place this code before applyStrategy:
enable.rule(stratstocky, type="chain", "StopTrail", enable=TRUE)
The rule will not become enabled or active. The only way to activate the rule it to change it's internal enable to TRUE
. I have tried exact spelling but it is not working for me.
This is not a big issue as I can just parameterize the rule's internal enable and control it this way but would prefer to use the existing code to run my system.
Any insight into enable.rule
issues?