OPEN-SOURCE SCRIPT
LRLR & HRLR Liquidity Runs V2

Its primary purpose is to automatically identify, classify, and connect consecutive swing highs and swing lows to highlight potential Liquidity Runs based on ICT/Smart Money Concepts.
Here is a breakdown of how it works:
1. Pivot Identification
The script relies on identifying structural pivot points (swing highs and lows).
It uses ta.pivothigh and ta.pivotlow to find these points.
By default, a pivot is confirmed if the price is the highest/lowest point compared to the 5 bars on its left and 5 bars on its right (customizable via leftBars and rightBars inputs).
2. Core Logic (LRLR vs HRLR)
Once a new pivot is identified, the script compares it to the immediate previous pivot of the same type to classify the resistance of the liquidity run:
For Pivot Highs (Resistance/Tops):
LRLR (Low Resistance Liquidity Run): If the new Pivot High is Lower than or Equal to the previous Pivot High. (Price failed to break the previous high, leaving clean liquidity above).
HRLR (High Resistance Liquidity Run): If the new Pivot High is Higher than the previous Pivot High. (Price successfully broke the previous high, taking out the liquidity).
For Pivot Lows (Support/Bottoms):
LRLR (Low Resistance Liquidity Run): If the new Pivot Low is Higher than or Equal to the previous Pivot Low. (Price failed to break the previous low, leaving clean liquidity below).
HRLR (High Resistance Liquidity Run): If the new Pivot Low is Lower than the previous Pivot Low. (Price successfully broke the previous low, taking out the liquidity).
3. Visual Output
Whenever a new pivot is confirmed, the script draws a Line connecting the previous pivot to the new pivot.
The color of the line changes based on whether it's an LRLR (default Greenish) or an HRLR (default Reddish).
A Text Label ("LRLR" or "HRLR") is plotted precisely at the midpoint of the line for easy visual identification.
Here is a breakdown of how it works:
1. Pivot Identification
The script relies on identifying structural pivot points (swing highs and lows).
It uses ta.pivothigh and ta.pivotlow to find these points.
By default, a pivot is confirmed if the price is the highest/lowest point compared to the 5 bars on its left and 5 bars on its right (customizable via leftBars and rightBars inputs).
2. Core Logic (LRLR vs HRLR)
Once a new pivot is identified, the script compares it to the immediate previous pivot of the same type to classify the resistance of the liquidity run:
For Pivot Highs (Resistance/Tops):
LRLR (Low Resistance Liquidity Run): If the new Pivot High is Lower than or Equal to the previous Pivot High. (Price failed to break the previous high, leaving clean liquidity above).
HRLR (High Resistance Liquidity Run): If the new Pivot High is Higher than the previous Pivot High. (Price successfully broke the previous high, taking out the liquidity).
For Pivot Lows (Support/Bottoms):
LRLR (Low Resistance Liquidity Run): If the new Pivot Low is Higher than or Equal to the previous Pivot Low. (Price failed to break the previous low, leaving clean liquidity below).
HRLR (High Resistance Liquidity Run): If the new Pivot Low is Lower than the previous Pivot Low. (Price successfully broke the previous low, taking out the liquidity).
3. Visual Output
Whenever a new pivot is confirmed, the script draws a Line connecting the previous pivot to the new pivot.
The color of the line changes based on whether it's an LRLR (default Greenish) or an HRLR (default Reddish).
A Text Label ("LRLR" or "HRLR") is plotted precisely at the midpoint of the line for easy visual identification.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.