How to compare conditions and use if else?

I am using Amibroker and want to compare some conditions and execute some if the condition is true or execute some other if condition is false.

If in Amibroker works differently. I want to compare simple condition like 100 Moving Average is greater than 200 Moving Average, how do I do this?

I tried:

condition = MA(C, 100) > MA(C, 200);

if (condition) {
    // This results in error
}

Official docs say you can’t use array in if block so how do I check the above condition?

You can use the IIF() https://www.amibroker.com/guide/afl/iif.html that works on arrays. You can also use for loop and iterate through each element of the condition array.

for(i =0; i < barcount; i++)
{
if(condition[i])
{
// Statements
}
}