OPEN-SOURCE SCRIPT
LL-HL Pivot

This indicator scans for the bullish structure known as a Higher Low (HL) across multiple lengths simultaneously, automatically selects the most suitable pattern, and plots it on the chart.
Below is a detailed explanation of how it works.
1. Basic Calculation Method (Definition of LL and HL)
This indicator is built on TradingView’s ta.pivotlow function.
Detecting Pivot Lows
For a given length, a Pivot Low is identified as the lowest point among the candles within the specified range to the left and right.
LL and HL Determination
LL (Lowest Low): The most recent Pivot Low is treated as the previous low.
HL (Higher Low): When a new Pivot Low forms above the previous LL, it is recognized as an HL, and the setup is considered “complete.”
Identifying the Pivot Line
During the LL–HL structure, the highest high between them is identified and used as the breakout level (Pivot Line / resistance), where a horizontal line is drawn.
2. Multi-Length Scanning
Unlike standard indicators that use only one length (e.g., Length = 5), this indicator evaluates a full range of lengths.
Min Length to Max Length
Example: Min = 2, Max = 10
Internally, it functions as if nine separate indicators (Length 2, 3, 4 … 10) are running simultaneously.
This allows the indicator to capture:
Small waves (short-term pullbacks)
Larger waves (broader structural moves)
3. Priority Mode System
Because multiple lengths are calculated at the same time, different LL–HL patterns may appear simultaneously.Priority Mode determines which setup is selected and displayed.
A. Lowest LH
Selects the pattern with the lowest pivot line (intermediate high).
Advantages:
Produces the lowest possible entry price
B. Longest Length
Selects the pattern with the longest length.
Advantages:
Focuses on larger structures and broader waves
Filters out noise
C. Shortest Length
Selects the pattern with the shortest length.
Advantages:
Reacts quickly to small moves
Useful for scalping or fast trend-following
Captures very short-term pullbacks
4. Additional Behavior and Features
Real-Time Invalidation
If price breaks below the confirmed HL, the structure is immediately considered invalid.
All previously drawn lines and labels are removed instantly, preventing outdated structures from remaining on the chart.
Pivot Line Extension
As long as the HL remains intact, the Pivot Line (breakout level) continues extending to the right.
Alerts
An alert can be triggered the moment price breaks above the Pivot Line on a closing basis.
Below is a detailed explanation of how it works.
1. Basic Calculation Method (Definition of LL and HL)
This indicator is built on TradingView’s ta.pivotlow function.
Detecting Pivot Lows
For a given length, a Pivot Low is identified as the lowest point among the candles within the specified range to the left and right.
LL and HL Determination
LL (Lowest Low): The most recent Pivot Low is treated as the previous low.
HL (Higher Low): When a new Pivot Low forms above the previous LL, it is recognized as an HL, and the setup is considered “complete.”
Identifying the Pivot Line
During the LL–HL structure, the highest high between them is identified and used as the breakout level (Pivot Line / resistance), where a horizontal line is drawn.
2. Multi-Length Scanning
Unlike standard indicators that use only one length (e.g., Length = 5), this indicator evaluates a full range of lengths.
Min Length to Max Length
Example: Min = 2, Max = 10
Internally, it functions as if nine separate indicators (Length 2, 3, 4 … 10) are running simultaneously.
This allows the indicator to capture:
Small waves (short-term pullbacks)
Larger waves (broader structural moves)
3. Priority Mode System
Because multiple lengths are calculated at the same time, different LL–HL patterns may appear simultaneously.Priority Mode determines which setup is selected and displayed.
A. Lowest LH
Selects the pattern with the lowest pivot line (intermediate high).
Advantages:
Produces the lowest possible entry price
B. Longest Length
Selects the pattern with the longest length.
Advantages:
Focuses on larger structures and broader waves
Filters out noise
C. Shortest Length
Selects the pattern with the shortest length.
Advantages:
Reacts quickly to small moves
Useful for scalping or fast trend-following
Captures very short-term pullbacks
4. Additional Behavior and Features
Real-Time Invalidation
If price breaks below the confirmed HL, the structure is immediately considered invalid.
All previously drawn lines and labels are removed instantly, preventing outdated structures from remaining on the chart.
Pivot Line Extension
As long as the HL remains intact, the Pivot Line (breakout level) continues extending to the right.
Alerts
An alert can be triggered the moment price breaks above the Pivot Line on a closing basis.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.