How can scan stocks using pi

Dear Zerodha,

                          Share Market open at 9.15 AM, in marketing days. 1hour later(10.15 AM) i need to check(Scan) all the NSE Stock

 (1) Open  Price < LTP(Last Traded Price)

 (2) Open price > Previous day Close price

1)How can i check above two conditions using  Pi or Kite?

2) Ortherwise there is any other possiblities to scan all the NSE stock above conditions?

yes you can use

LAST > REF(OPEN,4) AND REF(OPEN,4) > REF(CLOSE,5) 

but, use 15 minute charts and you have to start scanner at 10.15 manually

Hi AlgoGeek,
Will the above query scan all the available stocks in NSE?
Where do i need to paste the above query in Pie/Kite?
Can you please let us know how this can be done with the help of Pie/Kite.

REF(OPEN,4), what is 4 here
REF(CLOSE,5) what is 5 here

It is for PI and 4 is a parameter represents previous 4th candle