Need algos code for backtest intraday strategies in pi

Hi, i need algos code to backtest intraday strategies.

  1. Buy When the price goes 2Rs up over 1st 15 minute candle high, Target 0.5% , Stoploss below 2Rs of 1st 15 minute candle low.

  2. Sell When the price goes 2Rs down below 1st 15 minute candle low, Target 0.5% , Stoploss over 2Rs of 1st 15 minute candle high.