OPEN-SOURCE SCRIPT
Impulse Range Compression & Expansion (IRCE)

📌 Impulse Range Compression & Expansion (IRCE) – Visualizing Price Traps Before Breakouts
📖 Overview
The IRCE Indicator is a precision breakout detection tool designed to identify consolidation traps and price coil zones before expansion moves occur. Unlike traditional volatility indicators that rely solely on statistical thresholds (e.g., Bollinger Bands or ATR), IRCE focuses on behavioral price compression, detecting tight-range candle clusters and validating breakouts through body expansion and/or volume surges.
This makes it ideal for traders looking to:
• Catch breakouts from range traps
• Avoid choppy and premature signals
• Spot early-stage momentum moves based on clean price behavior
⸻
⚙️ How It Works
1. Impulse Range Compression Detection
• Measures the high-low range of each candle
• Compares it to a user-defined average range (default 7 bars)
• Flags candles where the range is significantly smaller (e.g., <60% of average)
• Groups these into tight clusters, indicating compression zones or potential “trap ranges”
2. Cluster Box Construction
• When a valid cluster (e.g., 3 or more tight candles) is detected, the indicator:
• Marks the high and low of the cluster
• Draws a shaded box over this “trap zone”
• This helps visually track where price has coiled before a breakout
3. Breakout Confirmation Logic
A breakout from the trap zone is only validated when:
• Price closes above the cluster high (bullish) or below the cluster low (bearish)
• One or both of the following confirm strength:
• Body Expansion: Current candle body is 120%+ of recent average
• Volume Expansion: Volume exceeds recent volume average
4. Optional Trend Filter
• An optional EMA filter (default: 50 EMA) ensures breakout signals align with trend direction
• Helps filter out countertrend noise in ranging markets
5. Signal Cooldown
• Prevents repeated signals by enforcing a cooldown period (e.g., 10 bars) between entries
⸻
🖥️ Visual Elements
• 📦 Yellow compression boxes represent tight price traps
• 🟢 Buy labels appear when price breaks above the trap with confirmation
• 🔴 Sell labels appear when price breaks below with confirmation
• All visuals are non-repainting and updated in real-time
🧠 How to Use
1. Wait for a yellow trap box to appear
2. Watch for a confirmed breakout from the trap zone
3. Take the trade in the direction of the breakout:
• Only if it satisfies body or volume confirmation
• And if trend alignment is enabled, it must match EMA direction
4. Place stops just outside the opposite end of the trap zone
5. Use risk/reward ratios or structure levels for exits
This logic works great on:
• Lower timeframes (scalping breakouts)
• Higher timeframes (detecting price coiling before major moves)
• Any market: Stocks, Crypto, FX, Commodities
⸻
🔒 Technical Notes
• ✅ No repainting
• ✅ No future-looking logic
• ✅ Suitable for both discretionary and systematic traders
• ✅ Built in Pine Script v6
📖 Overview
The IRCE Indicator is a precision breakout detection tool designed to identify consolidation traps and price coil zones before expansion moves occur. Unlike traditional volatility indicators that rely solely on statistical thresholds (e.g., Bollinger Bands or ATR), IRCE focuses on behavioral price compression, detecting tight-range candle clusters and validating breakouts through body expansion and/or volume surges.
This makes it ideal for traders looking to:
• Catch breakouts from range traps
• Avoid choppy and premature signals
• Spot early-stage momentum moves based on clean price behavior
⸻
⚙️ How It Works
1. Impulse Range Compression Detection
• Measures the high-low range of each candle
• Compares it to a user-defined average range (default 7 bars)
• Flags candles where the range is significantly smaller (e.g., <60% of average)
• Groups these into tight clusters, indicating compression zones or potential “trap ranges”
2. Cluster Box Construction
• When a valid cluster (e.g., 3 or more tight candles) is detected, the indicator:
• Marks the high and low of the cluster
• Draws a shaded box over this “trap zone”
• This helps visually track where price has coiled before a breakout
3. Breakout Confirmation Logic
A breakout from the trap zone is only validated when:
• Price closes above the cluster high (bullish) or below the cluster low (bearish)
• One or both of the following confirm strength:
• Body Expansion: Current candle body is 120%+ of recent average
• Volume Expansion: Volume exceeds recent volume average
4. Optional Trend Filter
• An optional EMA filter (default: 50 EMA) ensures breakout signals align with trend direction
• Helps filter out countertrend noise in ranging markets
5. Signal Cooldown
• Prevents repeated signals by enforcing a cooldown period (e.g., 10 bars) between entries
⸻
🖥️ Visual Elements
• 📦 Yellow compression boxes represent tight price traps
• 🟢 Buy labels appear when price breaks above the trap with confirmation
• 🔴 Sell labels appear when price breaks below with confirmation
• All visuals are non-repainting and updated in real-time
🧠 How to Use
1. Wait for a yellow trap box to appear
2. Watch for a confirmed breakout from the trap zone
3. Take the trade in the direction of the breakout:
• Only if it satisfies body or volume confirmation
• And if trend alignment is enabled, it must match EMA direction
4. Place stops just outside the opposite end of the trap zone
5. Use risk/reward ratios or structure levels for exits
This logic works great on:
• Lower timeframes (scalping breakouts)
• Higher timeframes (detecting price coiling before major moves)
• Any market: Stocks, Crypto, FX, Commodities
⸻
🔒 Technical Notes
• ✅ No repainting
• ✅ No future-looking logic
• ✅ Suitable for both discretionary and systematic traders
• ✅ Built in Pine Script v6
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Thanks.
TradeTech Analysis
Telegram Channel - t.me/Tradetech2024
Youtube Channel - youtube.com/@TradeTechAnalysis
Website - tradetechanalysis.com/
Super Profile - superprofile.bio/tradetechanalysis
TradeTech Analysis
Telegram Channel - t.me/Tradetech2024
Youtube Channel - youtube.com/@TradeTechAnalysis
Website - tradetechanalysis.com/
Super Profile - superprofile.bio/tradetechanalysis
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Thanks.
TradeTech Analysis
Telegram Channel - t.me/Tradetech2024
Youtube Channel - youtube.com/@TradeTechAnalysis
Website - tradetechanalysis.com/
Super Profile - superprofile.bio/tradetechanalysis
TradeTech Analysis
Telegram Channel - t.me/Tradetech2024
Youtube Channel - youtube.com/@TradeTechAnalysis
Website - tradetechanalysis.com/
Super Profile - superprofile.bio/tradetechanalysis
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.