OPEN-SOURCE SCRIPT

Dynamic Fibonacci Auto [forexobroker]

969
🔶 OVERVIEW

Dynamic Fibonacci Auto calculates Fibonacci retracement and extension levels automatically from confirmed swing highs and swing lows, updating dynamically as new pivots form. The indicator highlights the 50%-61.8% "Golden Zone" -- the area where the highest-probability retracements tend to find support or resistance -- and fires entry signals when price bounces from this zone with trend, volume, and candle direction confirmation.

This tool is designed for traders who use Fibonacci levels as a core part of their analysis but want to eliminate the manual process of dragging retracement tools onto the chart every time a new swing forms. It works on any instrument and any timeframe, automatically adapting its levels to the most recent confirmed market structure.

🔶 CONCEPTS

Fibonacci retracement levels are derived from the mathematical Fibonacci sequence and are used to identify potential support and resistance levels during a pullback within a trend. The key levels -- 23.6%, 38.2%, 50%, 61.8%, and 78.6% -- represent proportions of a prior move where price is statistically more likely to find a reaction. The 50%-61.8% range is known as the "Golden Zone" because it represents a deep enough retracement to offer favorable risk-reward, yet not so deep that it suggests the prior trend has failed. Extension levels (127.2%, 161.8%) project potential targets beyond the original swing.

🔶 HOW IT WORKS

- Detects swing highs and swing lows using a configurable pivot lookback length on both sides
- Determines trend direction based on whether the most recent swing low preceded the most recent swing high (uptrend) or vice versa
- Calculates all standard Fibonacci retracement levels (23.6%, 38.2%, 50%, 61.8%, 78.6%) and extension levels (127.2%, 161.8%) from the last confirmed swing range
- Draws levels as horizontal lines with a highlighted Golden Zone box between the 50% and 61.8% levels
- Fires signals when price enters the Golden Zone, forms a directional candle (bullish for uptrend, bearish for downtrend), closes above the zone midpoint, confirms with EMA trend alignment and volume filter

🔶 HOW TO USE

1. Add the indicator to any chart -- Fibonacci levels and the Golden Zone appear automatically once swing points are detected
2. Watch for price to pull back into the highlighted Golden Zone (the shaded area between 50% and 61.8%)
3. BUY arrows fire during uptrends when price bounces bullishly from the Golden Zone; SELL arrows fire during downtrends
4. Signal labels show the nearest Fibonacci level, current price, and suggested SL/TP levels based on ATR
5. Use extension levels (127.2%, 161.8%) as potential profit targets beyond the original swing. Always confirm with broader market context and define your stop-loss.

🔶 FEATURES

- Non-repainting signals (barstate.isconfirmed)
- Works on all timeframes and instruments
- 9 alert conditions with JSON webhook support
- ATR-based stop-loss and take-profit levels on signal labels
- Visual Golden Zone highlight with optional background tint when price is inside the zone

🔶 SETTINGS GUIDE

- Swing Detection Length -- Bars to the left and right required to confirm a pivot point
- Trend EMA Length -- Period for the EMA used to confirm trend direction on bounce signals
- Volume SMA Length -- Period for the volume filter
- Signal Cooldown -- Minimum bars between signals
- Show 23.6% / 38.2% / 50% / 61.8% / 78.6% -- Toggle individual Fibonacci levels
- ATR Length -- Period for stop-loss and take-profit calculation
- SL ATR Multiplier -- Stop-loss distance as a multiple of ATR
- Show SL/TP on Labels -- Toggle stop-loss and take-profit display
- Show Extension Levels -- Toggle 127.2% and 161.8% extension lines
- Show Golden Zone Fill -- Toggle the shaded box between 50% and 61.8%
- Show Golden Zone Background -- Toggle background tint when price is inside the zone
- Show Info Table -- Toggle the dashboard

🔶 ALERTS

- Bullish Fib Bounce -- Price bounces bullishly from Golden Zone in uptrend
- Bearish Fib Bounce -- Price bounces bearishly from Golden Zone in downtrend
- Price in Golden Zone -- Price enters the 50%-61.8% zone
- New Swing High -- New confirmed swing high detected
- New Swing Low -- New confirmed swing low detected
- Any Fib Signal -- Any confirmed Fibonacci bounce signal
- Unconfirmed Bull Bounce -- Golden Zone bounce without full filter confirmation
- Unconfirmed Bear Bounce -- Golden Zone bounce without full filter confirmation
- Fib Range Expansion -- Fibonacci range expands significantly (new wider swing detected)

🔶 LIMITATIONS & DISCLAIMER

- This is a technical analysis tool, not financial advice. Always use proper risk management.
- Fibonacci levels are not guaranteed support/resistance -- they represent areas of potential interest, not certainties.
- Swing detection requires lookback bars on both sides, so levels update with a delay equal to the Swing Detection Length setting.
- In strongly trending markets with shallow pullbacks, price may not reach the Golden Zone before continuing.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.