Filter for greater than

how do I code if ma close 10 > ma close 30 > ma close 60 > ma close 200 ?

I tried but there is no result when I do backtest. Please help. Thank you

Hello
There are many conversation and examples under the tag iiif.

https://forum.amibroker.com/tags/c/afl/iif

@christopher987

It does not work because it is wrong AFL coding.

You have to connect via AND operator.
https://www.amibroker.com/guide/a_language.html

ma1 = MA(C, 10);
ma2 = MA(C, 30);
ma3 = MA(C, 60);
ma4 = MA(C, 200);

myCondition = MA1 > MA2 AND MA2 > MA3 AND MA3 > MA4;

Buy = myCondition;

Filter = Buy;
1 Like