Zerodha PI scanner code required

I need code for PI scanner for getting average price of stocks for given time frame.
I.E. :
i want to get Average of Open + Highest high (HH) + Lowest Low (LL) + Close from Dt : 01-04-2018 to 30-04-20018.
Thank you.