OPEN-SOURCE SCRIPT
Fractal Structure Auto Fibo

Fractal Structure Auto Fibo
This tool is designed for price action traders and structural analysts who want to optimize their charting. It automatically identifies valid market swings using fractal logic, draws clear ZigZag lines, and automatically draws Fibonacci retracement levels for the most recent trading range.
Key Features
Dynamic Fractal Detection: Identifies valid swing peaks and troughs based on a user-defined review period (n). It filters out market noise and visually marks confirmed swing points with clear arrows (⮝ / ⮟).
- The difference from other Fractal indicators is that it scans fractal levels; if there are multiple consecutive highs or lows, it selects the highest/lowest as the main fractal level. Eliminate structural doubts.
Draw a live ZigZag map: Connect confirmed structural points to give you a clear, unambiguous view of the current market trend.
Smart automatic Fibonacci: Eliminate the need to manually draw Fibonacci retracement levels!


Automatically identify the nearest swing peaks and troughs.
Automatically reverse based on the current trend (0.0 is at the peak in an uptrend to measure corrections, and vice versa).
Extend dashed Fibonacci levels forward to the current candle to create a clean, uncluttered chart.
Settings & Customization
Fractal Period (n): Determines the sensitivity of the pivot points. Larger numbers filter out small corrections for macro structure, while smaller numbers capture small swings.
Automatic Fibonacci On/Off: Easily turn the Fibonacci display on or off to keep your chart clean. Includes customizable line and text colors.
For Developers (Open Source)
The code is highly optimized using Pine Script v5 array to manage drawing objects (Lines and Labels). It automatically removes old Fibonacci levels and dynamically redraws new ones, ensuring your platform doesn't reach its maximum line limit. Feel free to copy this script to add your own order conditions, alerts, or advanced SMC filters!
Happy using the script and successful trading!
This tool is designed for price action traders and structural analysts who want to optimize their charting. It automatically identifies valid market swings using fractal logic, draws clear ZigZag lines, and automatically draws Fibonacci retracement levels for the most recent trading range.
Key Features
Dynamic Fractal Detection: Identifies valid swing peaks and troughs based on a user-defined review period (n). It filters out market noise and visually marks confirmed swing points with clear arrows (⮝ / ⮟).
- The difference from other Fractal indicators is that it scans fractal levels; if there are multiple consecutive highs or lows, it selects the highest/lowest as the main fractal level. Eliminate structural doubts.
Draw a live ZigZag map: Connect confirmed structural points to give you a clear, unambiguous view of the current market trend.
Smart automatic Fibonacci: Eliminate the need to manually draw Fibonacci retracement levels!
Automatically identify the nearest swing peaks and troughs.
Automatically reverse based on the current trend (0.0 is at the peak in an uptrend to measure corrections, and vice versa).
Extend dashed Fibonacci levels forward to the current candle to create a clean, uncluttered chart.
Settings & Customization
Fractal Period (n): Determines the sensitivity of the pivot points. Larger numbers filter out small corrections for macro structure, while smaller numbers capture small swings.
Automatic Fibonacci On/Off: Easily turn the Fibonacci display on or off to keep your chart clean. Includes customizable line and text colors.
For Developers (Open Source)
The code is highly optimized using Pine Script v5 array to manage drawing objects (Lines and Labels). It automatically removes old Fibonacci levels and dynamically redraws new ones, ensuring your platform doesn't reach its maximum line limit. Feel free to copy this script to add your own order conditions, alerts, or advanced SMC filters!
Happy using the script and successful trading!
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.