Hi everyone, I am trying to automate the identification of a specific candle pattern. I had a go at this last night but couldn't think of a way to do it. I had limited success with the impulse block as it doesn't identify specifically a break of a certain amount of candles.

So in the picture I am trying to identify the impulsive 3 candle break (I need to identify similar setups of at least 2 candles). How could I identify this?
I was thinking maybe a (minimum) 2 bull bar break with (total) candle length a minimum of 3x the average candle size over the last x candles period. But I couldn't find anything that could give me the average candle range over the past x candles. Anyone have any ideas?