Need code for back test

need code for following condition.

Buy - if price break previous candle high.

sell - if price break previous candle low.

As per the above condition

Buy Script:

LAST > REF(HIGH,1)

Sell Script:

LAST < REF(LOW,1)
1 Like

Thanks AlgoGeek.