Algo code help pleaseeee!

Intraday
Entry or buy : 7th candle if that candle(7th candle) breaks the 6th candle’s High for a 2min chart.
Short sell : 7th candle, If that candle(7th candle) breaks the 6th candle’s Low for a 2min chart.

Buy Script:
 

CROSSOVER(REF(CLOSE,7),REF(HIGH,6))

Sell Script:
 

CROSSOVER(REF(CLOSE,6),REF(HIGH,7))

Thank You so much

Its not taking the 6th and 7th candle of the candle chart instead it gets applied for so many candles of the intraday chart, is there any other way t code? so that it gets applied to only 6 and 7th candle of the days chart irrespective of how many days specified
THANK YOU