Can someone, who is using psar in script alert give me the correct code for using psar crossover as filter

I have tried the two shown below.Both of them give wrong alerts in backtesting. Not sure about real time alerts though.

a) CLOSE > PSAR (CLOSE, 0.02, 0.2) AND REF (CLOSE, 1) < REF (PSAR (CLOSE, 0.02, 0.2), 1)

b)CROSSOVER(CLOSE, PSAR(CLOSE,0.02, 0.2))

Exit Long

CROSSOVER(CLOSE, PSAR(CLOSE, 0.02, 0.2))

Exit Short

CROSSOVER(PSAR(CLOSE, 0.02, 0.2), CLOSE)

Already using this code.When used in backtesting many times the crossover points are not included in backtesting…Though it is clear that the crossover occured. Is it a error only during backtesting or it also occurs while going live…