Help in coding for entry at opening time

Buy conditions -

  • immediately after opening the market i.e 9:15
  • buying of ATM options (Put & Call)

Exit -

  • 25% profit Target with Stop loss 5% & Trailing Stoploss of 5%

can you please help me in coding