[R-SIG-Finance] Adding "Stoploss disabled" to the parameter distribution for apply.paramset
Brian G. Peterson
brian at braverock.com
Fri May 26 13:24:52 CEST 2017
On Fri, 2017-05-26 at 10:34 +0000, Atakan Okan wrote:
> Is it possible to add a "disabled" option to the parameter
> distribution (for stoploss, stoptrailing, takeprofit)? So the typical
> parameter distribution contains a vector of integers, but how would I
> go about adding the "disabled stoploss" configuration to the
> parameter distribution? Adding "0" to the parameter distribution did
> not disable stoploss/takeprofit but made them execute immediately
> when there is a price change.
paramsets are designed for *parameters*.
So they aren't really designed for enabling or disabling rules. That
said, in theory you can change any element of the specification.
Something like this might work (untested, I have a meeting to run to),
please report back:
assume your rule is labeled 'my.stop'
, variable = list(enabled = c(TRUE,FALSE))
, label = 'onoff.test'
Please let us know, and if this doesn't work, maybe create a really
minimal example and we'll look more closely.
More information about the R-SIG-Finance