Is there any way to filter stocks on the basis of Pivot high and lows in a time frame

I was thinking to find some solution through which we can filter stocks on the basis of Pivot highs and lows made in a particular time for example last 20/30 candles. Can someone shed some light on it?

Example

             Pivot Highs Greater than equal to (2) in last 20 candles
             Pivot lows at least (1) in last 20 candles 

Pivot HL 10 10

Please don’t tag streak