OPEN-SOURCE SCRIPT
Atualizado Daily Structure Map

Plots key daily price levels and detects significant gap movements between sessions, helping traders quickly identify where price opened and closed relative to the previous day.
Features:
Daily Open & Close lines — color-coded red/green based on current price position, so you instantly know if price is trading above or below key daily levels
Day Separators — dashed vertical lines that mark the start of each new trading day, working consistently across all instruments including 24/7 markets like gold (XAUUSD) and crypto
GAP Signal — cross markers that fire when the percentage difference between two consecutive daily closes exceeds a configurable threshold, highlighting meaningful breakout gaps
Alerts — built-in long and short gap breakout alerts you can set and forget
Best used on intraday timeframes (1m–1H) to see daily structure overlaid on your lower timeframe charts. Fully customizable threshold, separator color, and timeframe seeker to adapt to any instrument or trading style.
Features:
Daily Open & Close lines — color-coded red/green based on current price position, so you instantly know if price is trading above or below key daily levels
Day Separators — dashed vertical lines that mark the start of each new trading day, working consistently across all instruments including 24/7 markets like gold (XAUUSD) and crypto
GAP Signal — cross markers that fire when the percentage difference between two consecutive daily closes exceeds a configurable threshold, highlighting meaningful breakout gaps
Alerts — built-in long and short gap breakout alerts you can set and forget
Best used on intraday timeframes (1m–1H) to see daily structure overlaid on your lower timeframe charts. Fully customizable threshold, separator color, and timeframe seeker to adapt to any instrument or trading style.
Notas de Lançamento
Week separator logic, short-vs-long name toggle, 1H-only restriction, custom horizontal offsets, background mode — all overkill for "minimum"Notas de Lançamento
Separator settings group — color, style (Solid/Dashed/Dotted dropdown), and width (1–5)Open/Close span settings group — same three controls for the horizontal day spans, since you'll likely want those styled too
Inputs grouped — group="..." parameter organizes the settings panel into clear sections instead of one long list
Style strings get converted to Pine's line.style_* constants via ternary lookup
Notas de Lançamento
Levels:PDH / PDL / PDC — Previous Day High, Low, Close
PWH / PWL — Previous Week High, Low
PMH / PML / PMC — Previous Month High, Low, Close
Notas de Lançamento
## Changelog — v1.1.0**Released:** May 2026
### Added
- **Levels** section: 8 previous-period reference lines drawn as right-extending rays anchored to their origin bars
- PDH, PDL, PDC — previous day high, low, close
- PWH, PWL — previous week high, low
- PMH, PML, PMC — previous month high, low, close
- Each level has its own toggle and color picker
- Shared line style (Solid / Dashed / Dotted) and width controls for all levels
- Right-side labels (PDH, PDL, etc.) that stay pinned to the latest bar
- Master "Show Levels" and "Show Labels" toggles
### Changed
- Daily open and previous close now render as **horizontal lines spanning the full width of each day** instead of per-bar dot stacks
- Open/Close Spans moved into its own settings group with color, style, and width controls
- Day Separators settings split into a dedicated group with color, style (Solid / Dashed / Dotted), and width controls
- Day-of-week labels (Mon, Tue, Wed…) shown above each new day with a color picker
- Indicator renamed from "Daily Close GAP Detector" to **Daily Structure Map**
- `max_bars_back` raised from 1000 to 5000 as a safety net
### Fixed
- Day separators not appearing on 24/7 instruments (XAUUSD, crypto). Now uses `ta.change(time("D"))` which works on all session types
- PML / PMH / PWL / PWH not drawing on lower timeframes due to `max_bars_back` lookback limits. Origin bars are now captured in real time as new highs/lows form, instead of being looked up via historical bar references
### Migration notes
- Existing alerts (`SHORT GAP BREAKOUT`, `LONG GAP BREAKOUT`) are unchanged
- Default settings reproduce a similar visual to v1.0 — no action needed after upgrade
- If you previously hid the dotted open/close circles by setting a transparent color, you can now toggle them off via "Show Daily Open/Close Spans"
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.