OPEN-SOURCE SCRIPT

Auto Fibonacci Retracement (Labeled Swings, Rounded Prices)

228
This tool automatically detects the latest confirmed swing high and swing low on your chart, using a user-settable pivot length. It then plots standard Fibonacci retracement levels between these confirmed pivots, labeling each retracement line with its percentage and rounded price for instant reference. All levels update only on swing confirmation, ensuring strict non-repainting logic and transparency.

How it works
Swing Detection:
Uses Pine Script’s native ta.pivothigh and ta.pivotlow functions to locate swing pivots after full confirmation, reducing noise and false signals.

Fibonacci Calculation:
Once two confirmed swings are found, the script draws standard Fibonacci retracement levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%) between these anchors. The levels adapt to both uptrends and downtrends, based on swing position.

Customization and Clarity:
Users can choose which retracement levels to display and adjust colors, line thickness, styles, and label sizes for chart clarity. All price labels are rounded for improved visibility.

Non-Repainting:
All levels are plotted only after a swing is confirmed by the market; nothing redraws retroactively.

How To Use It
  • Add the indicator to any chart and timeframe.
  • Select your preferred pivot length:
  • Smaller values yield more frequent swings, larger values wait for major structure.
  • Toggle each Fibonacci level you wish to see in the settings.
  • Adjust line and label appearance to fit your style.
  • Interpret retracement levels as potential support/resistance zones, awareness for pullbacks, and context for trend direction.
  • Combine the indicator with your technical, price action, or volume analysis to plan entries, stops, and targets.


What Traders Should Look For
Visual retracement map between confirmed swings:
Fib lines auto-update as new swings are confirmed, keeping your chart relevant.

Price reaction at Fib levels:
Watch for reversals, consolidations, or continuations near labeled percentages and prices.

Trend assessment:
Quickly spot whether market structure is showing shallow or deep retracements by the distance between levels.

Confluence:
Use retracement levels along with other indicators or market structure for more robust trade setups.

Key Features
  • Strict non-repainting logic (confirmed swings only)
  • Configurable retracement levels: Enable/disable each Fib line.
  • Rounded price & percentage labels
  • Visual customization: Colors, thickness, line style, label size
  • Automatic detection of direction (uptrend/downtrend pivots)


Disclaimer
This indicator is a technical analysis and educational tool. It does not provide buy/sell signals, nor guarantee future price movements. Please use in conjunction with your trading plan and risk management.

כתב ויתור

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.