PROTECTED SOURCE SCRIPT
Important Fractals

This script automatically detects Bill Williams–style fractals (pivot highs and pivot lows) and draws horizontal support and resistance levels based on confirmed structures in price action.
Each detected fractal creates a level that is actively monitored until a confirmed breakout occurs.
Core logic:
• Fractals are identified using ta.pivothigh and ta.pivotlow, with adjustable left and right bar settings.
• A horizontal level is drawn once the fractal is confirmed and is extended forward in time.
• A level is considered broken only after two consecutive candle closes on the wrong side of the level (not based on wick penetration).
• Option to either keep historical levels after breakout (stop extending them) or remove them completely.
• Adjustable maximum number of visible fractals to maintain chart clarity.
• Optional price labels displaying the exact level value.
Configurable parameters:
– Left / Right Bars – number of candles required to confirm a fractal
– Line Width / Line Style – visual customization of levels
– Keep Lines After Break – retain historical levels after breakout
– Maximum Visible Fractals – limit of active levels on the chart
– Show Fractal Value Labels – display price values next to levels
Use cases:
The script can be used to identify local market structure, observe support/resistance reactions, monitor breakout confirmations, and incorporate structural levels into breakout or retest-based trading systems.
Note that fractals are confirmed only after the required number of right-side candles, meaning they are structural (lagging) signals rather than predictive ones.
Each detected fractal creates a level that is actively monitored until a confirmed breakout occurs.
Core logic:
• Fractals are identified using ta.pivothigh and ta.pivotlow, with adjustable left and right bar settings.
• A horizontal level is drawn once the fractal is confirmed and is extended forward in time.
• A level is considered broken only after two consecutive candle closes on the wrong side of the level (not based on wick penetration).
• Option to either keep historical levels after breakout (stop extending them) or remove them completely.
• Adjustable maximum number of visible fractals to maintain chart clarity.
• Optional price labels displaying the exact level value.
Configurable parameters:
– Left / Right Bars – number of candles required to confirm a fractal
– Line Width / Line Style – visual customization of levels
– Keep Lines After Break – retain historical levels after breakout
– Maximum Visible Fractals – limit of active levels on the chart
– Show Fractal Value Labels – display price values next to levels
Use cases:
The script can be used to identify local market structure, observe support/resistance reactions, monitor breakout confirmations, and incorporate structural levels into breakout or retest-based trading systems.
Note that fractals are confirmed only after the required number of right-side candles, meaning they are structural (lagging) signals rather than predictive ones.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。