Adding "Stoploss disabled" to the parameter distribution for apply.paramset

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding "Stoploss disabled" to the parameter distribution for apply.paramset

Atakan Okan
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



        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: Adding "Stoploss disabled" to the parameter distribution for apply.paramset

braverock
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

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.