OPEN-SOURCE SCRIPT

Advanced Structure + Fib & PDH/PDL

7 920
Advanced Structure + Fib & PDH/PDL

How the Indicator Works

Hull Moving Average Trend Fill
The script uses a 70 period Hull Moving Average to determine the current market trend. The line turns green during bullish momentum and red during bearish momentum. A soft background color fills the space between the average line and candle close prices to provide a clear visual representation of trend strength without blocking candle view.


Clean Support and Resistance Lines
Support and resistance zones are created using pivot calculations. To keep the chart clean, lines are automatically removed as soon as price breaks through them, ensuring only active market levels stay visible.


Market Structure Identification
The indicator tracks price swings to mark Break of Structure (BOS) and Change of Character (CHoCH). BOS labels indicate trend continuation, while CHoCH labels signal potential trend reversals.


Dynamic Previous Day High and Low
Daily key levels are calculated at the start of each session. The script marks Previous Day High (PDH) and Previous Day Low (PDL) using clean badges. If price breaks a daily level during the trading session, the respective line and badge automatically vanish. The script also prevents daily lines from plotting if they overlap with existing support or resistance levels.


Intermediate Term High and Low
Major market swings are tagged with large ITH (Intermediate Term High) and ITL (Intermediate Term Low) badges. A 5 pip vertical offset is applied so that labels sit neatly above or below candle wicks.



Institutional Fibonacci Retracement
The script automatically finds the recent swing range to plot solid horizontal lines at the 0.50 (Equilibrium), 0.618 (Golden Pocket), and 0.786 (Discount) Fibonacci levels. These lines project toward the right margin to maintain an organized workspace.



Settings Guide
Moving Average Settings
MA Length: Adjusts the period for trend calculations. Default is 70.
Fill Transparency: Sets the opacity of the trend fill color.
Support and Resistance
Show Clean S/R Lines: Toggles horizontal support and resistance lines.
S/R Sensitivity: Adjusts the pivot lookback to filter major or minor levels.



SMC Structure
Show Clean BOS & CHoCH: Toggles market structure break labels.
Structure Sensitivity: Sets the swing detection length for structure breaks.
Previous Day High/Low
Show Active PDH/PDL Only: Toggles active daily high and low levels.



Major ITH & ITL
Show Major ITH & ITL Badges: Toggles swing high and low badges.
ITH/ITL Swing Length: Adjusts the bar count for identifying major swings.
Offset in Pips: Sets vertical spacing between badges and candles.



Institutional Fibonacci
Show Professional Clean Fib: Toggles dynamic Fibonacci levels.
Fibonacci Swing Length: Sets the range lookback for Fibonacci calculations.
Trading Guidelines and Best Practices


What to Focus On
Look for confluence where Fibonacci retracement levels align with active support or resistance lines.
Use BOS and CHoCH labels to confirm structure direction before evaluating key levels.
Monitor price reaction when price approaches active PDH or PDL levels.


What to Avoid
Avoid using structure labels in isolation without checking the broader trend direction shown by the Hull Moving Average.
Avoid trading directly into major ITH or ITL levels without confirming price action signals.

Educational Note
This script is developed strictly for technical analysis and educational purposes only. It does not provide financial advice, trading signals, or execution recommendations. Technical indicators process historical price data to assist in chart analysis, and past performance is not indicative of future results. Always apply proper risk management when analyzing financial markets.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.