OPEN-SOURCE SCRIPT
Обновлено Prior Day Dealing Range [M1D]

Frames the previous day's range as an ICT dealing range — high, low, equilibrium, quartiles, and premium/discount extreme zones — with a session-selectable day boundary, sweep mitigation, and a live bias table.
WHAT IT DOES
This indicator plots the prior trading day's range and frames it the way an ICT trader reads a dealing range, rather than as three disconnected lines:
• PDH / PDL — previous day high and low
• PDEQ — equilibrium (the 0.5 midpoint of the prior range)
• 0.25 / 0.75 quartiles — the boundaries that split the range into premium, equilibrium and discount
• Premium & discount extreme zones — the top quartile (0.75→1.0) and bottom quartile (0.0→0.25) shaded as the areas where price most often reacts
All levels and zones share a single left anchor at the day's open, so they read as one stacked range projecting into the current session.
WHY A DEALING RANGE INSTEAD OF JUST PDH/PDL
Equilibrium tells you whether price is trading at a premium (above 0.5) or a discount (below 0.5); the quartile zones mark the extremes where reversions and sweeps tend to cluster. The bias table reduces that to a single read.
SESSION-ANCHORED DAY OPEN
The "day" can be anchored to Exchange (the chart's native daily boundary, works on all timeframes), or to NY Midnight / 8:30 NY / 9:30 NY. The NY options reset the range on the open that matters to your model and are intended for intraday charts (roughly 30m and below); Exchange is the safe default for any timeframe.
MITIGATION
When a confirmed bar sweeps PDH or PDL, that line fades to a dotted "mitigated" style and its label updates. This is sweep awareness only, evaluated on bar close (no intrabar repaint).
BIAS TABLE
Shows the PDEQ price, which zone price currently sits in (Premium / Discount, with an "extreme" flag in a quartile zone), and the exact position of price within the prior range as a percentage.
ALERTS
Cross above / below PDEQ, entry into the premium / discount extreme zone, and PDH / PDL swept.
HOW TO USE
1. Pick your day anchor — Exchange for a standard daily range, or an NY session open if your model resets there.
2. Read bias from PDEQ: above = premium (favor shorts), below = discount (favor longs).
3. Watch the extreme zones and PDH/PDL for sweeps; the mitigation styling flags when a level has been run.
4. Toggle any element (zones, quartiles, labels, table) off in settings to suit your chart.
NOTES / LIMITATIONS
• Levels are confirmed on the close of each day and held for the following session; they do not repaint.
• NY-anchored modes assume the session window aligns to a bar boundary, so they are best on intraday timeframes; on higher timeframes use Exchange.
• This is a contextual / discretionary tool — it marks levels and bias, it does not generate buy/sell signals.
The previous-day high/low/equilibrium calculation is standard; this script's contribution is the combination — a session-selectable day boundary, the full quartile dealing-range framing with premium/discount extreme zones, sweep mitigation, and a range-position bias table in one tool. All code is original and written in Pine Script v6.
WHAT IT DOES
This indicator plots the prior trading day's range and frames it the way an ICT trader reads a dealing range, rather than as three disconnected lines:
• PDH / PDL — previous day high and low
• PDEQ — equilibrium (the 0.5 midpoint of the prior range)
• 0.25 / 0.75 quartiles — the boundaries that split the range into premium, equilibrium and discount
• Premium & discount extreme zones — the top quartile (0.75→1.0) and bottom quartile (0.0→0.25) shaded as the areas where price most often reacts
All levels and zones share a single left anchor at the day's open, so they read as one stacked range projecting into the current session.
WHY A DEALING RANGE INSTEAD OF JUST PDH/PDL
Equilibrium tells you whether price is trading at a premium (above 0.5) or a discount (below 0.5); the quartile zones mark the extremes where reversions and sweeps tend to cluster. The bias table reduces that to a single read.
SESSION-ANCHORED DAY OPEN
The "day" can be anchored to Exchange (the chart's native daily boundary, works on all timeframes), or to NY Midnight / 8:30 NY / 9:30 NY. The NY options reset the range on the open that matters to your model and are intended for intraday charts (roughly 30m and below); Exchange is the safe default for any timeframe.
MITIGATION
When a confirmed bar sweeps PDH or PDL, that line fades to a dotted "mitigated" style and its label updates. This is sweep awareness only, evaluated on bar close (no intrabar repaint).
BIAS TABLE
Shows the PDEQ price, which zone price currently sits in (Premium / Discount, with an "extreme" flag in a quartile zone), and the exact position of price within the prior range as a percentage.
ALERTS
Cross above / below PDEQ, entry into the premium / discount extreme zone, and PDH / PDL swept.
HOW TO USE
1. Pick your day anchor — Exchange for a standard daily range, or an NY session open if your model resets there.
2. Read bias from PDEQ: above = premium (favor shorts), below = discount (favor longs).
3. Watch the extreme zones and PDH/PDL for sweeps; the mitigation styling flags when a level has been run.
4. Toggle any element (zones, quartiles, labels, table) off in settings to suit your chart.
NOTES / LIMITATIONS
• Levels are confirmed on the close of each day and held for the following session; they do not repaint.
• NY-anchored modes assume the session window aligns to a bar boundary, so they are best on intraday timeframes; on higher timeframes use Exchange.
• This is a contextual / discretionary tool — it marks levels and bias, it does not generate buy/sell signals.
The previous-day high/low/equilibrium calculation is standard; this script's contribution is the combination — a session-selectable day boundary, the full quartile dealing-range framing with premium/discount extreme zones, sweep mitigation, and a range-position bias table in one tool. All code is original and written in Pine Script v6.
Информация о релизе
Names sit at the end of their linePDH, PDEQ and PDL now sit at the right end of their line, centred on it, with no background. They no longer straddle the price they name.
Everything ends together
Every level line and both premium and discount zones now stop at the same point to the right of price, and the names sit on that same edge. Line Extension sets how far it reaches. The separate Label Offset setting has been removed.
Steadier alerts
The Cross Above / Below PDEQ and Enter Premium / Discount Zone alerts now track every bar, so they fire on the bar the cross happens.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.