OPEN-SOURCE SCRIPT
Auto Fibonacci Zones

Auto Fibonacci Zones is a visual Fibonacci retracement tool built around confirmed swing pivots.
The script automatically detects the most recent significant swing leg using confirmed pivot highs and pivot lows, then draws Fibonacci retracement levels from that leg. It is designed to reduce the need for manually redrawing Fibonacci levels each time a new swing structure forms.
What the script shows
- Fibonacci retracement levels from the latest confirmed swing leg
- Optional Fibonacci extension levels
- A highlighted 0.5 - 0.618 retracement zone
- A dashed anchor leg showing the selected swing
- A compact state label describing the current retracement condition
- Optional alerts for key retracement events
How it works
The script uses confirmed pivot highs and confirmed pivot lows to define the current swing leg. A new Fibonacci sheet is accepted only when the detected high-low leg is large enough relative to ATR. This helps avoid redrawing levels on very small price movements.
The main retracement levels include:
- 0
- 0.382
- 0.5
- 0.618
- 0.786
- 1
The script can also show optional extension levels:
- 1.272
- 1.618
Extensions are disabled by default because they are reference geometry only and should not be interpreted as price forecasts.
Level sets
The user can choose between three level display modes:
- Core: shows 0, 0.5, 0.618, and 1
- Major: shows the main Fibonacci levels with a cleaner chart layout
- Standard: shows the common retracement levels
Golden zone
The script highlights the area between 0.5 and 0.618. This zone is commonly watched by traders as a retracement area, but it should not be treated as a guaranteed reversal zone or standalone trading signal.
State label
The state label gives a quick reading of the current retracement condition, such as:
- Shallow retracement
- Deep retracement
- Inside 0.5 - 0.618 zone
- Near full retrace
- Full retrace exceeded
- Beyond 0 level
The state label is only a descriptive reading of where price is relative to the current Fibonacci sheet.
Old or inactive sheets
The script includes options to fade older or fully retraced Fibonacci sheets. This helps keep the chart clean when the selected swing leg is no longer fresh or has already been fully retraced.
Main settings
Swing Detection:
- Pivot strength
- Minimum leg height x ATR
Levels:
- Level set
- Show extensions
- Shade 0.5 - 0.618 zone
Display:
- Show anchor leg
- Show level labels
- Show level prices
- Show state label
- State label offset
- Fade old / invalid sheet
- Expire sheet after bars
Lines and colors:
- Level line width
- Key level line width
- Anchor leg width
- Level colors
- Golden zone color
- Extension color
- Label colors
- Transparency controls
Alerts
The script includes alert conditions for:
- Price entering the 0.5 - 0.618 zone
- Price exiting the 0.5 - 0.618 zone
- Price crossing the 0.618 level
- Price touching or exceeding the 1.0 retracement level
- Price retesting the 0 level
These alerts are descriptive chart events. They are not buy or sell signals.
Repainting and confirmation note
This script uses confirmed pivot highs and confirmed pivot lows. A pivot can only be confirmed after the selected pivot-strength bars have passed.
Because of this, Fibonacci anchors appear only after confirmation. When a newer valid swing leg is confirmed, the current Fibonacci sheet can be replaced by the new one.
This is normal confirmation delay for pivot-based tools. The script does not use lookahead, and the levels are based on confirmed swing structure.
Limitations
Fibonacci levels are visual reference levels, not predictive levels.
A price reaction near any Fibonacci level does not guarantee continuation, reversal, support, or resistance.
The selected swing leg is determined automatically by the script. In some cases, a trader may manually choose a different swing leg based on broader market context.
This indicator is intended for chart analysis, education, and visual review of retracement structure. It is not a trading system, financial advice, or a standalone buy/sell tool.
The script automatically detects the most recent significant swing leg using confirmed pivot highs and pivot lows, then draws Fibonacci retracement levels from that leg. It is designed to reduce the need for manually redrawing Fibonacci levels each time a new swing structure forms.
What the script shows
- Fibonacci retracement levels from the latest confirmed swing leg
- Optional Fibonacci extension levels
- A highlighted 0.5 - 0.618 retracement zone
- A dashed anchor leg showing the selected swing
- A compact state label describing the current retracement condition
- Optional alerts for key retracement events
How it works
The script uses confirmed pivot highs and confirmed pivot lows to define the current swing leg. A new Fibonacci sheet is accepted only when the detected high-low leg is large enough relative to ATR. This helps avoid redrawing levels on very small price movements.
The main retracement levels include:
- 0
- 0.382
- 0.5
- 0.618
- 0.786
- 1
The script can also show optional extension levels:
- 1.272
- 1.618
Extensions are disabled by default because they are reference geometry only and should not be interpreted as price forecasts.
Level sets
The user can choose between three level display modes:
- Core: shows 0, 0.5, 0.618, and 1
- Major: shows the main Fibonacci levels with a cleaner chart layout
- Standard: shows the common retracement levels
Golden zone
The script highlights the area between 0.5 and 0.618. This zone is commonly watched by traders as a retracement area, but it should not be treated as a guaranteed reversal zone or standalone trading signal.
State label
The state label gives a quick reading of the current retracement condition, such as:
- Shallow retracement
- Deep retracement
- Inside 0.5 - 0.618 zone
- Near full retrace
- Full retrace exceeded
- Beyond 0 level
The state label is only a descriptive reading of where price is relative to the current Fibonacci sheet.
Old or inactive sheets
The script includes options to fade older or fully retraced Fibonacci sheets. This helps keep the chart clean when the selected swing leg is no longer fresh or has already been fully retraced.
Main settings
Swing Detection:
- Pivot strength
- Minimum leg height x ATR
Levels:
- Level set
- Show extensions
- Shade 0.5 - 0.618 zone
Display:
- Show anchor leg
- Show level labels
- Show level prices
- Show state label
- State label offset
- Fade old / invalid sheet
- Expire sheet after bars
Lines and colors:
- Level line width
- Key level line width
- Anchor leg width
- Level colors
- Golden zone color
- Extension color
- Label colors
- Transparency controls
Alerts
The script includes alert conditions for:
- Price entering the 0.5 - 0.618 zone
- Price exiting the 0.5 - 0.618 zone
- Price crossing the 0.618 level
- Price touching or exceeding the 1.0 retracement level
- Price retesting the 0 level
These alerts are descriptive chart events. They are not buy or sell signals.
Repainting and confirmation note
This script uses confirmed pivot highs and confirmed pivot lows. A pivot can only be confirmed after the selected pivot-strength bars have passed.
Because of this, Fibonacci anchors appear only after confirmation. When a newer valid swing leg is confirmed, the current Fibonacci sheet can be replaced by the new one.
This is normal confirmation delay for pivot-based tools. The script does not use lookahead, and the levels are based on confirmed swing structure.
Limitations
Fibonacci levels are visual reference levels, not predictive levels.
A price reaction near any Fibonacci level does not guarantee continuation, reversal, support, or resistance.
The selected swing leg is determined automatically by the script. In some cases, a trader may manually choose a different swing leg based on broader market context.
This indicator is intended for chart analysis, education, and visual review of retracement structure. It is not a trading system, financial advice, or a standalone buy/sell tool.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。