Filter depends on different market conditions

How can I use the filter ?
Filter= 1 it shows me all in the explore
Filter = C > MA(C,20) here it shows me only if this condition is right
I would like if for example
C > MA(c,20) then use Filter= Roc(C,20) > 5 or
C < MA(c,20) then use Filter = Roc(c,20) > 10
How can I use different Filters for different conditions.
Thanks for help.

Filter = IIF ((C > MA(c,20) AND Roc(C,20) > 5) or (C < MA(c,20) AND Roc(C,20) > 10 ) , 1, 0);

rc = ROC(C,20);

// if C > MA20 then filter by ROC20 > 5 
// else if C < MA20 then filter by ROC20 > 10
Filter = IIf( C > MA(C, 20), rc > 5, rc > 10 );
3 Likes

thanks fxshrat:smiley: