Back test codes for gap up opening & gap down opening

hi coders

Kindly provide me codes for the purpose of back testing in zerodha PI

  1. if there is gap up opening then Sell ( stoploss=10 points, target = 10 points)
  2. if there is gap down opening then Buy (sl=10, target=10)

thank you team.