Pi Scanner/AI/Codes/Tradescript

How do I filter stocks
where last 15-minute candle closed at high (close=high) with more than 5 or 10 or 15 or 20 candles’s average volume

Also for the sell signals
I’m looking at last 15-minute candle closed at low (close = low) with more than 5 or 10 or 15 or 20 candles average volume