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
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
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
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
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
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.