skb
Pine Script Rookie
Pine Script Rookie
Posts: 3
Joined: April 23rd, 2021

Need help in pattern search

Hello,

I'm trying to build an indicator that searches for the following pattern:

Red "leg" candle
Followed by 1 to 4 "base" candles
Followed by 1 to 4 green "leg" candles
Followed by a "base" candle

Is there some code you can point me to that can satisfy the condition "if the next 1 to 4 candles are base, true but if it's 5, false"?

Steve

Return to “Pine Script Q&A”