Implicit AND relationship of BUY rules

I'm a newbie and would like to know how to input rules that are not with "AND" relations. That is, there are 10 buy rules and they are of a bit similar to each other. Any one of the 10 will be sufficient to open a position. How can I make them with OR relation instead of AND ? thanks

Hi!

I think you can use setvar() to do this. Make a variable for each condition, for example:
setvar(@r0,frank("netfcfttm/mktcap",#sector)>80) setvar(@r1,frank("DbtS2NITTM",#sector)<30)

And then add the rule:
@r0+@r1>0

As long as a single condition is met, this inequality will be >0.

1 Like

There are two general ways to do this. One is to use the "Or" command (which can also be written as |). The other is, as test_user suggests, using a plus command and a >0 result. The key with the Or command is to keep all the rules on one line. The key with using plus and setvar is to remember that an inequality or equation that is true gets a value of 1 while an inequality or equation that is false or NA gets a value of 0. Also, setvar is a rule that excludes no stocks.

2 Likes