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.
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน