My stratagy involves 2 previous candles and current candle, Can you code?

can you code, i have a strategy

It involves 2 previous candles and current candle

Buy : if (Close of previous candle > High of previous to previous candle) and the current price > High of previous candle.

Sell : if (Close of previous candle < Low of previous to previous candle) and the current price < Low of previous candle.

Buy:

REF (CLOSE, 1) > REF (HIGH, 2) AND CLOSE > REF (HIGH, 1)

Sell:

REF (CLOSE, 1) < REF (LOW, 2) AND CLOSE < REF (LOW, 1)
2 Likes