PROTECTED SOURCE SCRIPT
Güncellendi

Swing Failure Pattern (SFP) Detector

144
Description
The Swing Failure Pattern (SFP) Detector is a powerful tool designed to help traders identify potential liquidity grabs and reversal zones using local and higher timeframe (HTF) swing points.

🧠 What It Does
This indicator detects Swing Failure Patterns—a price action concept where price breaks a previous swing high/low but closes back within range, suggesting a failed breakout and potential reversal. It highlights both local SFPs and HTF SFPs for added confluence.

⚙️ Core Logic

Swing Detection: Uses pivot highs/lows over a configurable length or an optional dynamic length based on ATR volatility.

SFP Criteria:

Bearish SFP: High exceeds last swing high, but candle closes below that swing level.

Bullish SFP: Low undercuts last swing low, but candle closes above that swing level.

HTF Support: Detects higher timeframe pivots using request.security() and overlays HTF SFPs on the current chart.

Visual Aids: SFP labels and optional background highlights are drawn when a valid pattern is detected. Dashed horizontal lines track the last swing points used in the logic.

Alerts: Four alert conditions are provided to notify users of local and HTF SFPs.

📌 How To Use It

Apply this indicator to any chart and timeframe.

Use dynamic length mode for adaptive responsiveness in volatile or low-volume environments.

Watch for SFPs at known liquidity zones (e.g., support/resistance, OB/FVG zones).

Use HTF SFPs as confirmation for higher conviction entries or exits.

🔒 Closed Source Justification
While the SFP concept is known, this script introduces a dual-frame detection engine that synchronizes pivot points across timeframes, applies volatility-adjusted swing detection, and includes a memory-efficient rendering logic to maintain responsiveness—even on dense charts. These enhancements provide practical trading edge and execution confidence that go beyond standard open-source implementations.

📈 Best Use Cases

Liquidity sweep confirmations

Smart Money Concept (SMC) trading

HTF/MTF alignment strategies

Reversal entries and scalp setups

🛠️ Inputs

Swing Length for Current TF: Set the fixed lookback period for local swings.

Use Dynamic Swing Length (ATR-Based): Enable auto-adjusting lookback using volatility.

Higher Timeframe for SFP Overlay: Select your HTF (e.g., D for daily).

Swing Length for HTF: Set HTF pivot detection sensitivity.

Highlight Background on SFP: Toggle background color highlighting on detection.

Disclaimer
This tool is intended for educational and informational purposes only. Trading involves risk, and past performance does not guarantee future results. Always do your own research and consult a financial advisor if necessary.

Sürüm Notları
- Bug fixing for dynamic length calculations.
- Add debounce bar config to avoid many SFP detection one after another candle.
Sürüm Notları
- set default length to 5 bar for actual tf and mtf.
- set default length to 5 bar for debounce.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.