Help me to code this..for pi

please code this rule for Zerodha Pi.

buy above 1st 5 min candle high. (that is, high between 9:15 am to 9:20 am)
cover after 3% target from 1st 5 min candle high, not from buying price…

For the above given requirement it is not possible to code based on percentages