How can execute code in pi

i want to execute these code in pi

CLOSE > SMA(CLOSE,50)

where i have to type these code and execute these code in pi?

i have to execute the above  conditions for all nse stocks in sigle exectution.

Check this post: http://zerodha.com/z-connect/tradezerodha/pi-tradezerodha/eas-for-auto-buysell-signals-pi

You can also check this webinar: https://www.youtube.com/watch?v=Hg5iZzvBV1A