How to select timeframe for algo

Hi, I want to write algo code foe 2 min time frame. Based on the samples it seems it is on 1 day time frame.

Also, for exit strategy (sell) how to have based on say 2% appreciation or Stoploss.

Can we create an order based on certain strategy along with a stoploss?

Can we change the stoploss as in trailing stoploss?