Need help writing a code alert

I need to set alert to all the stock in the nifty index.

When the stocks price approaches its previous close-2 points i need to get an alert.

Is that possible ? please help!

It’s possible as a %, not absolute points. using google stock screener