OPEN-SOURCE SCRIPT
RTH Levels: VWAP + PDH/PDL + ONH/ONL + IB

Algo Index — Levels Pro (ONH/ONL • PDH/PDL[RTH] • VWAP±Bands • IB • Gaps)
Purpose. A session-aware, non-repainting levels tool for intraday decision-making. Designed for futures and indices, with clean visuals, alerts, and a one-click Minimal Mode for screenshot-ready charts.
What it plots
• PDH/PDL (RTH-only) – Prior Regular Trading Hours high/low, computed intraday and frozen at the RTH close (no 24h mix-ups, no repainting).
• ONH/ONL – Prior Overnight high/low, held throughout RTH.
• RTH VWAP with ±σ bands – Volume-weighted variance, reset each RTH.
• Initial Balance (IB) – First N minutes of RTH, plus 1.5× / 2.0× extensions after IB completes.
• Today’s RTH Open & Prior RTH Close – With gap detection and “gap filled” alert.
• Killzone shading – NY Open (09:30–10:30 ET) and Lunch (11:15–13:30 ET).
• Values panel (top-right) – Each level with live distance in points & ticks.
• Right-edge level tags – With anti-overlap (stagger + vertical jitter).
• Price-scale tags – Native trackprice markers that always “stick” to the axis.
⸻
New in v6.4
• Minimal Mode: one click for a clean look (thinner lines, VWAP bands/IB extensions hidden, on-chart right-edge labels off; price-scale tags remain).
• Theme presets: Dark Hi-Contrast / Light Minimal / Futures Classic / Muted Dark.
• Anti-overlap controls: horizontal staggering, vertical jitter, and baseline offset to keep tags readable even when levels cluster.
⸻
Quick start (2 minutes)
1. Add to chart → keep defaults.
2. Sessions (ET):
• RTH Session default: 09:30–16:00 (US equities cash hours).
• Overnight Session default: 18:00–09:29.
Adjust for your market if you use different “day” hours (e.g., many use 08:20–13:30 ET for COMEX Gold).
3. Theme & Minimal Mode: pick a Theme Preset; enable Minimal Mode for screenshots.
4. Visibility: toggle PD/ON/VWAP/IB/References/Panel to taste.
5. Right-edge labels: turn Show Right-Edge Labels on. If they crowd, tune:
• Anti-overlap: min separation (ticks)
• Horizontal offset per tag (bars)
• Vertical jitter per step (ticks)
• Right-edge baseline offset (bars)
6. Alerts: open Add alert → Condition: [Levels Pro] and pick the events you want.
⸻
How levels are computed (no repainting)
• PDH/PDL: Intraday H/L are accumulated only while in RTH and saved at RTH close for “yesterday’s” values.
• ONH/ONL: Accumulated across the defined Overnight window and then held during RTH.
• RTH VWAP & ±σ: Volume-weighted mean and standard deviation, reset at the RTH open.
• IB: First N minutes of RTH (default 60). Extensions (1.5×/2.0×) appear after IB completes.
• Gaps: Today’s RTH open vs prior RTH close; “Gap Filled” triggers when price trades back to prior close.
⸻
Practical playbooks (how to trade around the levels)
1) PDH/PDL interactions
• Rejection: Price taps PDH/PDL then closes back inside → mean-reversion toward VWAP/IB.
• Acceptance: Close/hold beyond PDH/PDL with momentum → continuation to next HTF/IB target.
• Alert: PD Touch/Break.
2) ONH/ONL “taken”
• Often one ON extreme is taken during RTH. ONH Taken / ONL Taken → check if it’s a clean break or sweep & reclaim.
• Sweep + reclaim near VWAP can fuel rotations through the ON range.
3) VWAP ±σ framework
• Balanced: First tag of ±1σ often reverts toward VWAP.
• Trend: Persistent trade beyond ±1σ + IB break → target ±2σ/±3σ.
• Alerts: VWAP Cross and VWAP Reject (cross then immediate fail back).
4) IB breaks
• After IB completes, a clean IB break commonly targets 1.5× and sometimes 2.0×.
• Quick return inside IB = possible fade back to the opposite IB edge/VWAP.
• Alerts: IB Break Up / Down.
5) Gaps
• Gap-and-go: Opening drive away from prior close + VWAP support → trend until IB completion.
• Gap-fill: Weak open and VWAP overhead/underfoot → trade toward prior close; manage on Gap Filled alert.
Pro tip: Stack confluences (e.g., ONL sweep + VWAP reclaim + IB hold) and respect your execution rules (e.g., require a 5-minute close in direction, or your order-flow confirmation).
⸻
Inputs you’ll actually touch
• Sessions (ET): Session Timezone, RTH Session, Overnight Session.
• Visibility: toggles for PD/ON/VWAP/IB/Ref/Panel.
• VWAP bands: set σ multipliers (±1/±2/±3).
• IB: duration (minutes) and extension multipliers (1.5× / 2.0×).
• Style & Theme: Theme Preset, Main Line Width, Trackprice, Minimal Mode, and anti-overlap controls.
⸻
Alerts included
• PD Touch/Break — High ≥ PDH or Low ≤ PDL
• ONH Taken / ONL Taken — First in-RTH take of ONH/ONL
• VWAP Cross — Close crosses VWAP
• VWAP Reject — Cross then immediate fail back
• IB Break Up / Down — Break of IB High/Low after IB completes
• Gap Filled — Price trades back to prior RTH close
Setup: Add alert → Condition: Algo Index — Levels Pro → choose event → message → Notify on app/email.
⸻
Panel guide
The top-right panel shows each level plus live distance from last price:
LevelValue (Δpoints | Δticks)
Coloring: green if level is below current price, red if above.
⸻
Styling & screenshot tips
• Use Theme Preset that matches your chart.
• For dark charts, “Dark Hi-Contrast” with Main Line Width = 3 works well.
• Enable Trackprice for crisp axis tags that always stick to the right edge.
• Turn on Minimal Mode for cleaner screenshots (no VWAP bands or IB extensions, on-chart tags off; price-scale tags remain).
• If tags crowd, increase min separation (ticks) to 30–60 and horizontal offset to 3–5; add vertical jitter (4–12 ticks) and/or push tags farther right with baseline offset (bars).
⸻
Behavior & limitations
• Levels are computed incrementally; tables refresh on the last bar for efficiency.
• Right-edge labels are placed at bar_index + offset and do not track extra right-margin scrolling (TradingView limitation). The price-scale tags (from trackprice) do track the axis.
• “RTH” is what you define in inputs. If your market uses different day hours, change the session strings so PDH/PDL reflect your definition of “yesterday’s session.”
⸻
FAQ
Q: My PDH/PDL don’t match the daily chart.
A: By design this uses RTH-only highs/lows, not 24h daily bars. Adjust sessions if you want a different definition.
Q: Right-edge tags overlap or don’t sit at the far right.
A: Increase min separation / horizontal offset / vertical jitter and/or push tags farther with baseline offset. If you want markers that always hug the axis, rely on Trackprice.
Q: Can I change killzones?
A: Yes—edit the session strings in settings or request a version with user inputs for custom windows.
⸻
Disclaimer
Educational use only. This is not financial advice. Always apply your own risk management and confirmation rules.
⸻
Enjoy it? Please ⭐ the script and share screenshots using Minimal Mode + a Theme Preset that fits your style.
Purpose. A session-aware, non-repainting levels tool for intraday decision-making. Designed for futures and indices, with clean visuals, alerts, and a one-click Minimal Mode for screenshot-ready charts.
What it plots
• PDH/PDL (RTH-only) – Prior Regular Trading Hours high/low, computed intraday and frozen at the RTH close (no 24h mix-ups, no repainting).
• ONH/ONL – Prior Overnight high/low, held throughout RTH.
• RTH VWAP with ±σ bands – Volume-weighted variance, reset each RTH.
• Initial Balance (IB) – First N minutes of RTH, plus 1.5× / 2.0× extensions after IB completes.
• Today’s RTH Open & Prior RTH Close – With gap detection and “gap filled” alert.
• Killzone shading – NY Open (09:30–10:30 ET) and Lunch (11:15–13:30 ET).
• Values panel (top-right) – Each level with live distance in points & ticks.
• Right-edge level tags – With anti-overlap (stagger + vertical jitter).
• Price-scale tags – Native trackprice markers that always “stick” to the axis.
⸻
New in v6.4
• Minimal Mode: one click for a clean look (thinner lines, VWAP bands/IB extensions hidden, on-chart right-edge labels off; price-scale tags remain).
• Theme presets: Dark Hi-Contrast / Light Minimal / Futures Classic / Muted Dark.
• Anti-overlap controls: horizontal staggering, vertical jitter, and baseline offset to keep tags readable even when levels cluster.
⸻
Quick start (2 minutes)
1. Add to chart → keep defaults.
2. Sessions (ET):
• RTH Session default: 09:30–16:00 (US equities cash hours).
• Overnight Session default: 18:00–09:29.
Adjust for your market if you use different “day” hours (e.g., many use 08:20–13:30 ET for COMEX Gold).
3. Theme & Minimal Mode: pick a Theme Preset; enable Minimal Mode for screenshots.
4. Visibility: toggle PD/ON/VWAP/IB/References/Panel to taste.
5. Right-edge labels: turn Show Right-Edge Labels on. If they crowd, tune:
• Anti-overlap: min separation (ticks)
• Horizontal offset per tag (bars)
• Vertical jitter per step (ticks)
• Right-edge baseline offset (bars)
6. Alerts: open Add alert → Condition: [Levels Pro] and pick the events you want.
⸻
How levels are computed (no repainting)
• PDH/PDL: Intraday H/L are accumulated only while in RTH and saved at RTH close for “yesterday’s” values.
• ONH/ONL: Accumulated across the defined Overnight window and then held during RTH.
• RTH VWAP & ±σ: Volume-weighted mean and standard deviation, reset at the RTH open.
• IB: First N minutes of RTH (default 60). Extensions (1.5×/2.0×) appear after IB completes.
• Gaps: Today’s RTH open vs prior RTH close; “Gap Filled” triggers when price trades back to prior close.
⸻
Practical playbooks (how to trade around the levels)
1) PDH/PDL interactions
• Rejection: Price taps PDH/PDL then closes back inside → mean-reversion toward VWAP/IB.
• Acceptance: Close/hold beyond PDH/PDL with momentum → continuation to next HTF/IB target.
• Alert: PD Touch/Break.
2) ONH/ONL “taken”
• Often one ON extreme is taken during RTH. ONH Taken / ONL Taken → check if it’s a clean break or sweep & reclaim.
• Sweep + reclaim near VWAP can fuel rotations through the ON range.
3) VWAP ±σ framework
• Balanced: First tag of ±1σ often reverts toward VWAP.
• Trend: Persistent trade beyond ±1σ + IB break → target ±2σ/±3σ.
• Alerts: VWAP Cross and VWAP Reject (cross then immediate fail back).
4) IB breaks
• After IB completes, a clean IB break commonly targets 1.5× and sometimes 2.0×.
• Quick return inside IB = possible fade back to the opposite IB edge/VWAP.
• Alerts: IB Break Up / Down.
5) Gaps
• Gap-and-go: Opening drive away from prior close + VWAP support → trend until IB completion.
• Gap-fill: Weak open and VWAP overhead/underfoot → trade toward prior close; manage on Gap Filled alert.
Pro tip: Stack confluences (e.g., ONL sweep + VWAP reclaim + IB hold) and respect your execution rules (e.g., require a 5-minute close in direction, or your order-flow confirmation).
⸻
Inputs you’ll actually touch
• Sessions (ET): Session Timezone, RTH Session, Overnight Session.
• Visibility: toggles for PD/ON/VWAP/IB/Ref/Panel.
• VWAP bands: set σ multipliers (±1/±2/±3).
• IB: duration (minutes) and extension multipliers (1.5× / 2.0×).
• Style & Theme: Theme Preset, Main Line Width, Trackprice, Minimal Mode, and anti-overlap controls.
⸻
Alerts included
• PD Touch/Break — High ≥ PDH or Low ≤ PDL
• ONH Taken / ONL Taken — First in-RTH take of ONH/ONL
• VWAP Cross — Close crosses VWAP
• VWAP Reject — Cross then immediate fail back
• IB Break Up / Down — Break of IB High/Low after IB completes
• Gap Filled — Price trades back to prior RTH close
Setup: Add alert → Condition: Algo Index — Levels Pro → choose event → message → Notify on app/email.
⸻
Panel guide
The top-right panel shows each level plus live distance from last price:
LevelValue (Δpoints | Δticks)
Coloring: green if level is below current price, red if above.
⸻
Styling & screenshot tips
• Use Theme Preset that matches your chart.
• For dark charts, “Dark Hi-Contrast” with Main Line Width = 3 works well.
• Enable Trackprice for crisp axis tags that always stick to the right edge.
• Turn on Minimal Mode for cleaner screenshots (no VWAP bands or IB extensions, on-chart tags off; price-scale tags remain).
• If tags crowd, increase min separation (ticks) to 30–60 and horizontal offset to 3–5; add vertical jitter (4–12 ticks) and/or push tags farther right with baseline offset (bars).
⸻
Behavior & limitations
• Levels are computed incrementally; tables refresh on the last bar for efficiency.
• Right-edge labels are placed at bar_index + offset and do not track extra right-margin scrolling (TradingView limitation). The price-scale tags (from trackprice) do track the axis.
• “RTH” is what you define in inputs. If your market uses different day hours, change the session strings so PDH/PDL reflect your definition of “yesterday’s session.”
⸻
FAQ
Q: My PDH/PDL don’t match the daily chart.
A: By design this uses RTH-only highs/lows, not 24h daily bars. Adjust sessions if you want a different definition.
Q: Right-edge tags overlap or don’t sit at the far right.
A: Increase min separation / horizontal offset / vertical jitter and/or push tags farther with baseline offset. If you want markers that always hug the axis, rely on Trackprice.
Q: Can I change killzones?
A: Yes—edit the session strings in settings or request a version with user inputs for custom windows.
⸻
Disclaimer
Educational use only. This is not financial advice. Always apply your own risk management and confirmation rules.
⸻
Enjoy it? Please ⭐ the script and share screenshots using Minimal Mode + a Theme Preset that fits your style.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
If you want to contact me here is my Discord channel discord.gg/gvv3TK4m
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
If you want to contact me here is my Discord channel discord.gg/gvv3TK4m
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.