Tradescript code to buy using 5 min candles

Code for the following logic:

Buy when
Current price-5 min low price =RS 1
Trailing stop loss of RS 2

Thanks

LAST - LOW = 1