Support and Resistance Retest Breakout Signals [AlgoAlpha]🟠 OVERVIEW
This script identifies support and resistance zones using pairs of swing highs and swing lows that occur within a volatility-adjusted price tolerance. Instead of drawing levels from a single pivot, it waits for two matching swings to confirm a zone, helping filter out isolated highs and lows that may have little significance.
Each zone contains a buy/sell volume balance estimate calculated from lower timeframe data. This provides additional context about the activity that formed the zone and helps visualize whether buying or selling pressure was more dominant during its creation.
The script also tracks how price interacts with existing zones after they form. When price fully breaks through a zone and later retests it, bullish or bearish retest signals are generated based on the direction of the breakout.
🟠 CONCEPTS
Swing Matching — Two swing highs or two swing lows must occur within a volatility-adjusted tolerance before a resistance or support zone is created.
Volatility-Adjusted Tolerance — The script uses the standard deviation of price over a lookback period to determine how close swing points must be to qualify as the same zone.
Support and Resistance Zones — Zones are built from the full price structure around matched swing points rather than from a single horizontal price level.
Volume Balance — Lower timeframe buying and selling volume is aggregated between the two swings that formed the zone to estimate directional participation.
Breakout Retest Logic — Price must first move completely beyond a zone, then close through it, and finally revisit the zone before a retest signal is confirmed.
🟠 FEATURES
Support and Resistance Zones — Highlights confirmed support and resistance areas formed from recurring swing lows and swing highs.
Volume Balance Display — Shows buy and sell volume balance bars inside each zone for visual participation analysis.
Retest Signals — Displays signals when price breaks above a zone and successfully retests it.
🟠 HOW TO USE
Watch for newly formed support and resistance zones to identify areas where price has repeatedly reacted.
Compare the buy/sell balance bars inside each zone to understand the volume profile that formed the level.
Look for bullish retest signals after price breaks above a resistance zone and returns to test it from above.
Look for bearish retest signals after price breaks below a support zone and returns to test it from below.
Use larger Time Horizon values to focus on major market structure and smaller values to detect more frequent zones.
Enable overlap prevention when you want fewer but more distinct zones on the chart.
Use alerts to monitor new zones and confirmed retest events without continuously watching the chart.
🟠 CONCLUSION
Support and Resistance Retest Breakout Signals combines volatility-adjusted zone detection, lower timeframe volume balance analysis, and breakout retest confirmation into a single workflow. It identifies areas where price has repeatedly reacted, measures the participation behind those areas, and tracks whether breakouts successfully hold during retests. This gives traders a structured view of support, resistance, and post-breakout behavior.
Pine Script® インジケーター






















