Is it possible to write code for simple plus or mins 20 point strategy and test it in pi?

Eg - If Nifty Open price is 8000 i need nifty to either up 20 or down 20 and once its up go for a buy with 20 point SL and the same vice versa .

Yes, you can use Price alert Indicator check below link

https://zerodha.com/expert-advisors/code/price-alert-indicator

but what if there are more than 1 scrips to keep alerts for? bcoz expert adviser needs to mention price in the script.

yes for different scripts to scan it will not work.