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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。