Compression Patterns (w/ Trend + Proximity Filter)

This indicator identifies high-probability price compression patterns within trending environments — a setup prized by experienced swing and day traders alike. It combines the classic NR4, NR7, 2-Bar NR, 3-Bar NR, and Inside Day formations with a powerful trend filter and proximity logic to deliver clear, focused signals.
🔍 What's Inside:
▪️ Compression Patterns
The core of this tool lies in the logic of price compression. These patterns signal the market taking a breath — volatility contracts, volume dries up, and price coils like a spring.
When this happens in the right context, the next move is often explosive.
NR4 / NR7: Narrowest range in 4 or 7 bars — excellent for spotting the quiet before the storm.
2-Bar NR / 3-Bar NR: These identify the tightest consecutive 2 or 3-day ranges over the past 20 days — contextually rare and powerful.
Inside Day: A simple but highly effective consolidation pattern, especially when it clusters around key moving averages.
▪️ Trend Filter (EMA Stack)
You could say this is where most indicators fall apart — no context.
This one doesn’t make that mistake.
Signals only fire when the 10 EMA > 20 EMA > 50 EMA, and price is above the 20 EMA. That’s a strong, established uptrend — the only environment where breakouts are statistically favourable.
Why?
Because trend following works.
It may not give you fixed daily returns, but it’s the only strategy with theoretically infinite profit potential. You risk little, trade less, and position yourself for rare but massive moves. That’s the edge.
▪️ Proximity Filter (1 ATR to EMA)
We’ve added another layer of discipline. Signals only fire when price is:
Within 1 ATR of the 10 EMA (if price is above it), or
Within 1 ATR of the 20 EMA (if price is below the 10 EMA)
This ensures you’re not chasing. You’re waiting for tight, controlled pullbacks into dynamic support — exactly where institutions add size, not exit.
⚙️ Fully Customisable:
Toggle visibility of each pattern
Custom colours and transparency for label & background
Adjustable ATR length and multiplier
Change label text if needed (useful for translations or tweaks)
🎯 Ideal Use Case:
Swing trading off the daily chart
Day trading with VWAP/MACD filters (in alternate versions)
Supplementing price action strategies
🔚 Final Word:
This isn’t an “everything scanner.”
It’s a discerning sniper scope for traders who wait patiently for clean trends, tight consolidations, and perfect proximity — then strike.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.
Declinazione di responsabilità
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Per un accesso rapido a un grafico, aggiungi questo script ai tuoi preferiti: per saperne di più clicca qui.