D50 = ExponentialAverage[50](close) c1 = D50 > D50[1] c3 = D50 < D50[1] IF c1 THEN res = 1 ELSIF c3 THEN res = -1 ENDIF RETURN res as "ABC EMA 50 LUT"