OPEN-SOURCE SCRIPT
Breakout and Retest Signals - FloAlgo

This indicator detects breakout and retest signals by identifying key pivot zones and validating price rejection through wick sweeps and volume analysis.
How It Works
The script operates in three stages:
Key Advantages
Zone Lifecycle
Visual Elements
Key Settings
How It Works
The script operates in three stages:
- Pivot Zone Detection — Identifies swing highs and lows, then constructs zones anchored to the candle body and wick that formed the pivot. Demand zones span from body top down to wick low; supply zones span from wick high down to body bottom.
- Rejection Validation — Confirms a valid signal when price sweeps beyond the zone extreme (wick tip) and closes back through the zone body, indicating institutional liquidity capture.
- Volume Confirmation — Uses lower timeframe volume delta and buy/sell ratio to validate signal strength, filtering weak rejections with insufficient conviction.
Key Advantages
- No Repaint — Single-period pivot detection ensures signals fire on confirmed historical bars, eliminating repaint delay between alert and visual.
- Fixed Width Zones — Zones do not grow indefinitely; they are drawn with fixed horizontal width and trimmed only on signal, keeping charts clean.
- Range-Based Overlap Guard — Demand and supply zones cannot overlap; range-based checking prevents conflicting zones from occupying the same price area.
- Professional Visuals — No text labels or arrow clutter; only shaded zones and volume ratio splits for clean, professional appearance.
- Accurate Zone Geometry — Zones anchored to actual candle body and wick formations, not flat ATR bands.
- Auto-Cleanup — Zones are automatically removed one bar after signal or on expiry, preventing chart clutter.
- Seconds Chart Support — Volume timeframe input guarded to prevent errors on sub-minute charts.
- No Signal Conflicts — Removed confirmation divisor that caused opposing signals on the same bar.
Zone Lifecycle
- Unlike traditional indicators that grow zones indefinitely, this script uses a fixed-width approach:
- Zones are drawn from the pivot candle to a fixed future bar (born + maxLife)
- Upon signal, the zone right edge is trimmed to the signal bar
- The zone remains visible for one bar after the signal, then is automatically removed
- Expired zones without signals are cleanly purged to prevent chart clutter
Visual Elements
- Shaded boxes marking demand (green) and supply (red) pivot zones
- Volume ratio split boxes within zones showing buy/sell pressure balance
- Dashed target projection lines from signal bars
- Zone borders fade and thin out after signal confirmation
Key Settings
- Swing Length — Sensitivity of pivot high/low detection
- Max Bars Active — Fixed horizontal width of zones in bars
- Min Bars Between — Minimum bars between consecutive signals
- Max Zones Per Side — Maximum active zones per direction
- Volume TF — Frame for volume delta analysis
- Show Ratio Split — Display buy/sell volume ratio inside zones
- Show TP Line — Display target projection lines
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。