OPEN-SOURCE SCRIPT
Cập nhật TB DayProfile (stabil)

TB DayProfile Indicator
The TB DayProfile plots intraday price movements relative to the current day’s opening price. Each bar is shifted so that the daily open acts as a fixed zero line, making it easy to see how far the market has moved above or below the open during the session.
The indicator includes:
Relative intraday bars (iOpen, iHigh, iLow, iClose): Displayed as a custom bar chart, showing price action normalized to the day’s open.
Zero line with color signals: Turns green if the number of consecutive bars above the open exceeds a user-defined threshold, or red if below.
ATR reference bands: Daily ATR(5) from the previous day (scaled by 0.25) is plotted as upper and lower bands, helping to gauge typical intraday ranges.
This tool helps traders quickly identify whether the market is trending strongly away from the daily open, or if price is reverting back toward it, independent of the chosen chart timeframe.
The TB DayProfile plots intraday price movements relative to the current day’s opening price. Each bar is shifted so that the daily open acts as a fixed zero line, making it easy to see how far the market has moved above or below the open during the session.
The indicator includes:
Relative intraday bars (iOpen, iHigh, iLow, iClose): Displayed as a custom bar chart, showing price action normalized to the day’s open.
Zero line with color signals: Turns green if the number of consecutive bars above the open exceeds a user-defined threshold, or red if below.
ATR reference bands: Daily ATR(5) from the previous day (scaled by 0.25) is plotted as upper and lower bands, helping to gauge typical intraday ranges.
This tool helps traders quickly identify whether the market is trending strongly away from the daily open, or if price is reverting back toward it, independent of the chosen chart timeframe.
Phát hành các Ghi chú
TB DayProfile (stable) — Indicator Description & ChangelogOverview
TB DayProfile visualizes intraday price action **relative to the current day’s open**. It re-centers each bar around today’s open, highlights momentum streaks above/below that open, shows symmetric **ATR-based bands** from the **previous day’s ATR**, and (optionally) plots a **day-specific VWAP**—also expressed relative to today’s open. The study lives in its own pane (`overlay=false`).
How it works
* **Day anchor:** On each new calendar day, the script locks the day’s open (`todaysOpen`) and computes `iOpen/iHigh/iLow/iClose` as price minus that open.
* **Streak logic:** It counts consecutive closes above or below `todaysOpen`. When the count exceeds user thresholds, the zero line color shifts (green for up-streak, red for down-streak).
* **ATR envelope:** Pulls **previous day’s ATR** on the daily timeframe and multiplies it by a user-defined factor to form **symmetric upper/lower bands** around zero (i.e., around the day’s open in the relative scale).
* **Day VWAP (optional):** Computes a fresh VWAP each day using cumulative `(HLC3 × Volume) / Volume`, then plots **VWAP − todaysOpen** in the same relative scale.
* **Day separators:** Draws **vertical dotted lines** at each day change. Optional alternating background stripes can provide an additional day-by-day visual rhythm.
Inputs
* `BarsUp` / `BarsDown`: thresholds for consecutive closes above/below the day’s open (affects zero-line color).
* `ATR Length (Daily)`: ATR length used on the **daily** timeframe.
* `Band = prev ATR ×`: multiplier for the prior day’s ATR to size the bands.
* Toggles:
* **Vertical day separators** (on by default)
* **Alternating daily background** (off by default)
* **Show Day-VWAP** (on by default)
Plots
* **TB\_DayProfile**: Re-centered bar chart of intraday OHLC vs. today’s open (green if `iClose ≥ iOpen`, red otherwise).
* **Zero (Today’s Open)**: Horizontal line at 0; color reflects up/down streak condition.
* **Upper/Lower ATR band**: Symmetric guides at `±(prevDailyATR × multiplier)`.
* **Day VWAP (rel)** (optional): `VWAP − todaysOpen` as a line on the same scale.
Notes
* **Symbols without volume:** Day VWAP requires volume; on instruments with no volume (some indices/FX feeds) it will be `na`.
* **No `timeframe` arg in `indicator()`:** The script creates drawings (day separators), so it **does not** set a `timeframe` parameter in `indicator()` to avoid side-effect context errors.
* **Resets per day:** Streak counters and VWAP accumulators reset on `timeframe.change("D")`.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.