Want to backtest

I Want to backrest in 1hr candle if the 2nd candle break high go for buy and vice versa so plz .Create the script so that I can test. I saw for long time 99% accuracy for some stock

BUY Trade Script:

CLOSE > REF(HIGH,1)

SELL Trade Script:

CLOSE < REF(LOW,1)