OPEN-SOURCE SCRIPT
Aggiornato

Prev Day & Pre-Market Levels

1 643
Prev Day & Pre-Market Levels
This indicator automatically plots four key intraday reference levels directly on your chart:

PDH – Previous Day High: The highest price reached during the previous regular trading session (09:30–16:00 ET)
PDL – Previous Day Low: The lowest price reached during the previous regular trading session
PMH – Pre-Market High: The highest price reached during today's pre-market session (04:00–09:30 ET)
PML – Pre-Market Low: The lowest price reached during today's pre-market session

These levels are widely used by intraday and swing traders as dynamic support & resistance zones, breakout targets, and risk management references.
Features:

Lines update automatically at the start of each new session — no manual input needed
Fully customizable colors, line styles (Solid / Dashed / Dotted), and line width for each level independently
Optional price labels displayed on both sides of each line for quick reference
Adjustable right-label offset to control spacing from the last candle
Clean, minimal overlay with no chart clutter

Best used on: 1m, 2m, 3m, 5m, 15m, and 30m timeframes for US equities and futures.

⚠️ Requirements for Pre-Market lines (PMH / PML):

Extended Hours must be enabled — Right-click the chart → Settings → Symbol → ✅ Extended trading hours. Without this, TradingView does not load pre-market candles and PMH/PML will not appear.
Use an intraday timeframe — This indicator requires a timeframe of 30m or lower. Pre-market session detection does not work on Daily or higher timeframes.
Note di rilascio
Now you can set up alerts for the indicator levels.
Note di rilascio
Key Intraday Levels — PDH · PDL · PMH · PML · HOD · LOD
This indicator automatically plots six key intraday reference levels directly on your chart:

PDH – Previous Day High: The highest price of the previous regular session (09:30–16:00 ET)
PDL – Previous Day Low: The lowest price of the previous regular session
PMH – Pre-Market High: The highest price of today's pre-market session (04:00–09:30 ET)
PML – Pre-Market Low: The lowest price of today's pre-market session
HOD – High of Day: Live tracking of today's highest price (pre-market + regular session)
LOD – Low of Day: Live tracking of today's lowest price (pre-market + regular session)

These levels are widely used by intraday and swing traders as dynamic support & resistance zones, breakout targets, and risk management references.
Features:

All lines update automatically — no manual input needed
Fully customizable colors, line styles (Solid / Dashed / Dotted), and line width per group
Labels on both sides of each line with name tag and live price
Adjustable right-label offset for clean chart spacing
7 built-in alert conditions for every level + "ANY level" combined alert

Best used on: 1m, 2m, 3m, 5m, 15m, and 30m timeframes for US equities and futures.
Note di rilascio
PDL bug fixed.
Note di rilascio
v2.0 — Major Update

[Added HOD & LOD — Live High of Day and Low of Day levels, tracked across both pre-market and regular session

Fixed PDH/PDL reliability — Switched to request.security() daily timeframe data, resolving missing levels on ETFs like SPY and QQQ

Fixed Pre-Market detection — Now uses Pine's built-in session.ispremarket instead of manual time strings, works correctly on all symbols and brokers

Cleaner status line — Indicator line now shows PDH · PDL · PMH · PML · HOD · LOD instead of raw input values

Two new alerts — New High of Day and New Low of Day alerts added, both included in the "ANY level" combined alert

Right label offset — New setting to control spacing between the last candle and the right-side price labels
Note di rilascio
Performance improvment,
Note di rilascio
Labels no longer overlap when two or more levels are at similar prices — overlapping right-side labels are now automatically staggered into separate columns, keeping the chart clean and readable. Lines always remain at the exact correct price level.
Note di rilascio
Fixed duplicate lines and labels appearing on some charts — lines and labels are now properly cleared before each redraw, preventing multiple copies of the same level from stacking on top of each other when the chart updates.
Note di rilascio
HOD LOD bug fix
Note di rilascio
HOD and LOD now strictly track regular trading hours (09:30–16:00 ET) — values no longer change when switching between regular and extended hours chart modes.
Note di rilascio
**Added All Time High (ATH) level**
Tracks the instrument's all-time high using monthly data (600 bars ≈ 50 years). Displays as a gold dashed line with label, fully configurable in the new *All Time High* settings group. Includes a crossover alert and is covered by the "crossed ANY level" catch-all.
Note di rilascio
Fix ATH calc, scale label stagger to daily ATR, add distance filter to hide far levels
Note di rilascio
bug fux
Note di rilascio
Bu fix
Note di rilascio
What's new in this version:

PMH/PML now computed via extended-hours ticker (ticker.modify(... session=session.extended)) → works on RTH-only charts
Removed unused is_premarket chart-level flag (logic moved into the security context)
Everything else (ATH accumulator, adaptive gap, distance filter, anchor-level exemptions) preserved
Note di rilascio
Added time stamp to ATH.
If the same day, shows only hour, if before, shows date.
Note di rilascio
`Fix timestamp position — now sits cleanly above the ATH price label, left-aligned, with ATR-based clearance to prevent overlap`
Note di rilascio
Complete alerts options.
Note di rilascio
Bug fixes
Note di rilascio
Bug fix
Note di rilascio
Bug Fix
Note di rilascio
Fixes
Note di rilascio
DESIGN FINE TUNING
Note di rilascio
Bug fix
Note di rilascio
Bug fix
Note di rilascio
**Fix: Indicator no longer shifts the chart layout**

Labels are now anchored at the last bar (`bar_index`) instead of future bars — so adding the indicator no longer changes the chart zoom or visible range.
Note di rilascio
fix
Note di rilascio
Bugs fix.
Note di rilascio
Update — per-line styling + renamed chart label

Each level (PDH, PDL, PMH, PML, ATH, HOD, LOD) now has its own Line Style (Solid / Dashed / Dotted) and Width (1–5), in addition to color — so you can style every level independently.
Defaults are Dashed, width 1, so existing charts look unchanged until you adjust them.
Chart legend short title renamed from "Key Lvls" → "Key Levels".

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.