REversal Strategy

Dear Experts,

with my little knowledge i created below reversal strategy

Buy script:- if price goes below previous candle low and close higher than previous candle buy signa
Low > REf(Low,1) and
Close > ReF(Close,1)

Sell Script:- PRice goes above previous candle and close below previous candle buy signal
High < REf(High,1) and
Close < Ref(Close,1)

above strategy not working. kindly correct the above code Please

for the above given condition

Buy Script

LAST > REF(LOW,1) AND CLOSE>REF(CLOSE,1)

Sell Script:

LAST<REF(HIGH,1) AND CLOSE<REF(CLOSE,1)

Dear Expert,

Thank you,
Can you Please clarify me

Ref(Low,1) & REF(high,1) is for previous day candle or previous Candle

Previous candle on whatever timeframe you are testing.