How to screen all nifty stock in one shot for following pattern?

I want to auto screen stocks on every 10 min chart and provide results for bearing , bullish or for trend reversal. like

50 sma cross psar from downside to upside with : bearish breakdown

50 sma cross psar from upside to downside : bullish breakdown

As per the above condition use to different scanners one for bullish and another for bearish

Bearish:

CROSSOVER(SMA(CLOSE,50), PSAR(0.02, 0.2)) = TRUE

Bullish:

CROSSOVER( PSAR(0.02, 0.2), SMA(CLOSE,50)) = TRUE

Where to insert the above said script code. As there is no option to insert the above script code in SCANNER.