OPEN-SOURCE SCRIPT
Fractal Symmetry Detector [forexobroker]

Fractal Symmetry Detector identifies classical ABC retracement patterns on the chart and measures their Fibonacci symmetry in real time. It tracks the last three alternating swing pivots (A-B-C), computes the BC/AB retrace ratio, and validates it against the standard Fibonacci levels -- 38.2%, 50%, 61.8%, and 78.6%. When BC completes at one of those levels, the pattern is marked complete and a directional BUY or SELL signal fires with projected T1 and T2 targets at 1.272 and 1.618 extensions.
This indicator is designed for swing traders and harmonic traders who want to enter continuation moves at the deepest pullback rather than chase breakouts. The ABC pattern is drawn live with neon lines, the Fib level is labeled at point C, and target projections extend from C into the future.
🔶 CONCEPTS
Markets rarely move in straight lines. After an impulse move (leg AB), price typically pulls back (leg BC) before continuing. The depth of that pullback -- measured as BC divided by AB -- almost always respects one of four Fibonacci levels: 38.2% (shallow), 50% (halfway), 61.8% (golden), or 78.6% (deep). A retrace that completes at one of these levels with a confirming candle and volume often marks the end of the correction and the start of a continuation leg. This is the foundation of harmonic trading and explains why Fibonacci levels produce reversals so reliably.
🔶 HOW IT WORKS
- Detects ZigZag pivots using the configured pivot length, maintaining an alternating high/low sequence
- When a new pivot forms, checks the last three pivots (A-B-C); A and C must be the same type and B the opposite
- Computes BC/AB ratio and checks proximity to each enabled Fib level using the tolerance setting
- Assigns a symmetry score 0-100 based on how close the ratio is to the matched Fib level
- Fires BUY on valid bullish ABC (low-high-low) with a bullish candle and volume confirmation; SELL on mirror
- If the immediate bar at C does not confirm, the setup becomes PENDING for up to 5 bars awaiting confirmation
🔶 HOW TO USE
1. Add the indicator -- whenever a completed ABC pattern is detected, AB and BC lines are drawn in neon with a C-point Fib label
2. Watch the dashboard (top-right) for live pattern status, Fib level matched, BC/AB ratio, and projected targets
3. Green BUY triangle with "ABC ↑" label fires on bullish ABC completion; pink SELL triangle on bearish
4. When C completes but the immediate candle does not confirm, the pattern becomes PENDING -- the signal will fire on the next qualifying candle within 5 bars
5. Target lines draw from the signal bar to T1 (1.272x AB) and T2 (1.618x AB); use as profit-taking guides
🔶 FEATURES
- Non-repainting signals (barstate.isconfirmed)
- Works on all timeframes and instruments
- 9 alert conditions with JSON webhook support
- Pending-setup mechanism that catches delayed confirmations
- Projected T1 and T2 target lines drawn from every signal
🔶 SETTINGS GUIDE
- Pivot Length -- Lookback for ZigZag pivot detection
- ATR Length -- Period for leg-length measurement in ATR units
- Fib Level Tolerance -- Acceptable deviation from a Fib level (fraction)
- Accept 38.2% / 50.0% / 61.8% / 78.6% -- Toggle which Fib retrace levels qualify
- Target Ext 1 / 2 -- Projected CD extension multiples of AB (classical 1.272 and 1.618)
- Volume SMA Length -- Baseline for volume confirmation
- Volume Confirm Multiplier -- Signal bar volume vs SMA; 1.0 accepts average volume
- Signal Cooldown Bars -- Minimum bars between consecutive signals
- Require Reversal Candle at C -- Enforce direction-matching candle; disable to trigger on pattern completion alone
🔶 ALERTS
- FSD Buy ABC -- Bullish ABC pattern confirmed with buy signal
- FSD Sell ABC -- Bearish ABC pattern confirmed with sell signal
- FSD Any Signal -- Any directional ABC signal
- FSD Pattern Complete -- ABC pattern completed at a Fib level (before confirmation)
- FSD Golden Fib -- 50% or 61.8% retrace detected
- FSD Bull Setup Pending -- Bullish ABC waiting for confirmation candle
- FSD Bear Setup Pending -- Bearish ABC waiting for confirmation candle
- FSD Perfect Symmetry -- Symmetry score 90%+ reached
- FSD Webhook JSON -- Generic webhook payload for external automation
🔶 LIMITATIONS & DISCLAIMER
- This is a technical analysis tool, not financial advice. Always use proper risk management.
- Past ABC pattern completions do not guarantee future price movements.
- Pivot detection lags by the pivot length; patterns only print after the third pivot is confirmed.
- Fibonacci retracement levels are reference levels with no mechanical guarantee of producing a continuation leg; the indicator reports the pattern, not a probability.
This indicator is designed for swing traders and harmonic traders who want to enter continuation moves at the deepest pullback rather than chase breakouts. The ABC pattern is drawn live with neon lines, the Fib level is labeled at point C, and target projections extend from C into the future.
🔶 CONCEPTS
Markets rarely move in straight lines. After an impulse move (leg AB), price typically pulls back (leg BC) before continuing. The depth of that pullback -- measured as BC divided by AB -- almost always respects one of four Fibonacci levels: 38.2% (shallow), 50% (halfway), 61.8% (golden), or 78.6% (deep). A retrace that completes at one of these levels with a confirming candle and volume often marks the end of the correction and the start of a continuation leg. This is the foundation of harmonic trading and explains why Fibonacci levels produce reversals so reliably.
🔶 HOW IT WORKS
- Detects ZigZag pivots using the configured pivot length, maintaining an alternating high/low sequence
- When a new pivot forms, checks the last three pivots (A-B-C); A and C must be the same type and B the opposite
- Computes BC/AB ratio and checks proximity to each enabled Fib level using the tolerance setting
- Assigns a symmetry score 0-100 based on how close the ratio is to the matched Fib level
- Fires BUY on valid bullish ABC (low-high-low) with a bullish candle and volume confirmation; SELL on mirror
- If the immediate bar at C does not confirm, the setup becomes PENDING for up to 5 bars awaiting confirmation
🔶 HOW TO USE
1. Add the indicator -- whenever a completed ABC pattern is detected, AB and BC lines are drawn in neon with a C-point Fib label
2. Watch the dashboard (top-right) for live pattern status, Fib level matched, BC/AB ratio, and projected targets
3. Green BUY triangle with "ABC ↑" label fires on bullish ABC completion; pink SELL triangle on bearish
4. When C completes but the immediate candle does not confirm, the pattern becomes PENDING -- the signal will fire on the next qualifying candle within 5 bars
5. Target lines draw from the signal bar to T1 (1.272x AB) and T2 (1.618x AB); use as profit-taking guides
🔶 FEATURES
- Non-repainting signals (barstate.isconfirmed)
- Works on all timeframes and instruments
- 9 alert conditions with JSON webhook support
- Pending-setup mechanism that catches delayed confirmations
- Projected T1 and T2 target lines drawn from every signal
🔶 SETTINGS GUIDE
- Pivot Length -- Lookback for ZigZag pivot detection
- ATR Length -- Period for leg-length measurement in ATR units
- Fib Level Tolerance -- Acceptable deviation from a Fib level (fraction)
- Accept 38.2% / 50.0% / 61.8% / 78.6% -- Toggle which Fib retrace levels qualify
- Target Ext 1 / 2 -- Projected CD extension multiples of AB (classical 1.272 and 1.618)
- Volume SMA Length -- Baseline for volume confirmation
- Volume Confirm Multiplier -- Signal bar volume vs SMA; 1.0 accepts average volume
- Signal Cooldown Bars -- Minimum bars between consecutive signals
- Require Reversal Candle at C -- Enforce direction-matching candle; disable to trigger on pattern completion alone
🔶 ALERTS
- FSD Buy ABC -- Bullish ABC pattern confirmed with buy signal
- FSD Sell ABC -- Bearish ABC pattern confirmed with sell signal
- FSD Any Signal -- Any directional ABC signal
- FSD Pattern Complete -- ABC pattern completed at a Fib level (before confirmation)
- FSD Golden Fib -- 50% or 61.8% retrace detected
- FSD Bull Setup Pending -- Bullish ABC waiting for confirmation candle
- FSD Bear Setup Pending -- Bearish ABC waiting for confirmation candle
- FSD Perfect Symmetry -- Symmetry score 90%+ reached
- FSD Webhook JSON -- Generic webhook payload for external automation
🔶 LIMITATIONS & DISCLAIMER
- This is a technical analysis tool, not financial advice. Always use proper risk management.
- Past ABC pattern completions do not guarantee future price movements.
- Pivot detection lags by the pivot length; patterns only print after the third pivot is confirmed.
- Fibonacci retracement levels are reference levels with no mechanical guarantee of producing a continuation leg; the indicator reports the pattern, not a probability.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。