How to set condition to execute the algo run at the start of the minute and exit after booking target

Need step-by-step help to execute an algo at the start of the minute and exit after booking target of 10% or 10% SL.