Morning strategy code

buy= todays first 5 min. close > Previous day high and current price is greater than 1% of previous day high

sell=todays first 5 min. close < Previous day low and current price is less than 1% of previous day low

As per the above query can not be coded in tradescript based on % and different time frames as per your condition