OPEN-SOURCE SCRIPT
Aggiornato PD LLT replica (Python parity)

Automated Premium/Discount areas paired with a Logical Liquidity Target (LLT).
This is an independent, clean-room Pine v6 implementation of the premium/discount + LLT workflow (concept popularized by PD LLT and Trader Kane's Lab Model). No code was copied - it was written from scratch to mirror my own Python backtest module, so the chart drawings and the Python engine can be verified against each other bar by bar.
HOW IT WORKS
1. Dealing range = the latest CONFIRMED swing high + swing low pair (fractal pivots, "Pivot strength" input). Each newly confirmed pivot rotates the range to the latest pair. Optional "Growing area" mode rotates only when a pivot extends beyond the current extreme.
2. Every range is split at its 50% midpoint into a PREMIUM area (upper half) and a DISCOUNT area (lower half).
3. EQ cross: the close at range activation sets the baseline side; a flip of that side through the 50% Mid is the cross (up = bullish, down = bearish).
4. LLT: the first swing that CONFIRMS after the cross, on the cross side, becomes the Logical Liquidity Target (blue = bullish target, pink = bearish target).
5. Delivery: price touching the LLT fades the areas and prints a white diamond. Superseded (older) ranges keep tracking their LLT until delivery.
6. Alerts: "Mid Hit up/down" (50% cross) and "LLT Hit".
LOOK-AHEAD SAFETY
A swing of strength s is only drawn s bars after it prints - no level appears before the market could know it.
TIPS
- Default Pivot strength = 5 on intraday charts; lower it on higher timeframes.
- Enable "Growing area" if you prefer ranges that only expand on new extremes.
- Reduce "Older PD areas kept on chart" for a cleaner view.
This is an independent, clean-room Pine v6 implementation of the premium/discount + LLT workflow (concept popularized by PD LLT and Trader Kane's Lab Model). No code was copied - it was written from scratch to mirror my own Python backtest module, so the chart drawings and the Python engine can be verified against each other bar by bar.
HOW IT WORKS
1. Dealing range = the latest CONFIRMED swing high + swing low pair (fractal pivots, "Pivot strength" input). Each newly confirmed pivot rotates the range to the latest pair. Optional "Growing area" mode rotates only when a pivot extends beyond the current extreme.
2. Every range is split at its 50% midpoint into a PREMIUM area (upper half) and a DISCOUNT area (lower half).
3. EQ cross: the close at range activation sets the baseline side; a flip of that side through the 50% Mid is the cross (up = bullish, down = bearish).
4. LLT: the first swing that CONFIRMS after the cross, on the cross side, becomes the Logical Liquidity Target (blue = bullish target, pink = bearish target).
5. Delivery: price touching the LLT fades the areas and prints a white diamond. Superseded (older) ranges keep tracking their LLT until delivery.
6. Alerts: "Mid Hit up/down" (50% cross) and "LLT Hit".
LOOK-AHEAD SAFETY
A swing of strength s is only drawn s bars after it prints - no level appears before the market could know it.
TIPS
- Default Pivot strength = 5 on intraday charts; lower it on higher timeframes.
- Enable "Growing area" if you prefer ranges that only expand on new extremes.
- Reduce "Older PD areas kept on chart" for a cleaner view.
Note di rilascio
- bug fixesScript 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.