OPEN-SOURCE SCRIPT
已更新 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.
發行說明
Week separator logic, short-vs-long name toggle, 1H-only restriction, custom horizontal offsets, background mode — all overkill for "minimum"發行說明
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
發行說明
Levels:PDH / PDL / PDC — Previous Day High, Low, Close
PWH / PWL — Previous Week High, Low
PMH / PML / PMC — Previous Month High, Low, Close
發行說明
## 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"
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。