PureBytes Links
Trading Reference Links
|
Hi Alex,
Many thanks. I actually tried Philippe's code since it was ready
-made (:-) - heckuva lot of clever copying & pasting in there, Phillippe
(:-), many thanks to you, too - but it doesn't seem to be able to let
you selectively set some filters on and off and then optimise the
others. Your version seems to allow for that, Alex, is that right?
I ask because I can't quite see how to put it together in that way...
(:-( Sorry to be so dense. Would it be possible to give an example using
maybe three conditions, something concrete I can build on?
Thanks.
All the best,
Ian
> Ian:
> > I have a system that includes several filters such as:
> >
> > cond1=adx>adx[1]
> > cond2=h>h[1]
> > cond3=mom>mom[1]
> > cond4=
> > cond5=
> >
> > and so on.
>
> ...and you want to test all combinations, cond1+cond2,
> cond1+cond4+cond5,
> etc.
>
> This is easy to do. All you need to do is have a switch parameter for
> each condition. In the optimization, the start value for each switch
> is
> 0, the end value is 1, and the increment is 1. So each switch will
> have
> the values 0 or 1 during the optimization.
>
> Then in your strategy, you use those switches to include or ignore the
> associated conditions. i.e.
>
> combined_condition = iff(switch1=1, cond1, true);
> combined_condition = combined_condition and iff(switch2=1, cond2,
> true);
> combined_condition = combined_condition and iff(switch3=1, cond3,
> true);
> combined_condition = combined_condition and iff(switch4=1, cond4,
> true);
> combined_condition = combined_condition and iff(switch5=1, cond5,
> true);
> ...and so on.
>
> The final result of combined_condition will be true if ALL of the
> conditions that were switched on (switchX=1) are true.
> combined_condition
> will be false if any of the switched-on conditions are false.
>
> -Alex
>
>
>
|