Hi, 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. Thanks, Atakan Okan
Adding "Stoploss disabled" to the parameter distribution for apply.paramset
2 messages · Atakan Okan, Brian G. Peterson
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'
add.distribution( strategy=strategy.st
, paramset.label='stop.onoff'
, component.type='exit'
, component.label='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.
Regards,
Brian