Argument of IF not optional Error

SET A = Fn(CLOSE,30)

SET B = Fn(CLOSE,10)

SET Bottom = BBB(CLOSE, 30, 3, EXPONENTIAL)

SET Top = BBT(CLOSE, 30, 3, EXPONENTIAL)

SET X = IF(A > Top AND B > Top, 1 , -1)

I am constantly getting error “Argument of IF not optional”. What is the possible cause as script seems to be fine wrt to syntax?

As you are defining the above expression as x , IF condition is not required

Thanks AlgoGeek however my next step is to check for a crossover based on X contains True or False. Thats giving me wrong outcome. Whats your opinion?