VWAP table with color

## ๐ VWAP Table with Color โ Clear VWAP Deviation at a Glance
This script displays a **VWAP (Volume-Weighted Average Price)** table in a non-intrusive, color-coded panel on your chart. It helps you **quickly assess where the current price stands relative to VWAP**, classified into sigma bands (standard deviations). The goal is to provide valuable VWAP insight **without cluttering the chart with multiple lines**.
---
### ๐ Purpose & Concept
VWAP is a powerful tool used by institutional traders to measure the average price an asset has traded at throughout the day, based on both volume and price.
In this script:
- We **do not plot traditional VWAP lines** with multiple ยฑ1ฯ, ยฑ2ฯ, etc., on the chart.
- Instead, we **summarize VWAP and its relative position in a table**, color-coded by deviation.
- This provides the **same information**, but in a **cleaner, minimal, and visually digestible format**.
---
### ๐ง VWAP Deviation Classification
The script calculates how far the current price is from the VWAP, in units of **standard deviation (ฯ)**.
The formula is:
```plaintext
VWAP Delta ฯ = (Current Price - VWAP) / Standard Deviation
```
This gives you a normalized value for deviation from VWAP, and it is **clamped between -3 and +3** to avoid extreme outliers.
Each range is color-coded and classified as:
| VWAP ฮฯ | Zone | Interpretation | Color |
|---------|---------------|------------------------------------------|--------------|
| -3ฯ | Far Below | Strongly below VWAP โ potentially oversold | ๐ด Red |
| -2ฯ | Below | Below VWAP โ bearish territory | ๐ Orange |
| -1ฯ | Slightly Below| Slightly under VWAP โ weak signal | ๐ก Yellow |
| 0ฯ | At VWAP | Price is around VWAP โ neutral zone | โช Gray |
| +1ฯ | Slightly Above| Slightly above VWAP โ weak bullish | ๐ข Lime Green |
| +2ฯ | Above | Above VWAP โ bullish signal | ๐ข Green |
| +3ฯ | Far Above | Strongly above VWAP โ potentially overbought | ๐ฆ Teal |
This **compact summary in the table** provides a clear situational view while keeping the chart clean.
---
### โ๏ธ User Customization
Users can configure:
- **VWAP ฯ Multiplier** (default 0.1) to set the width of the optional VWAP band on the chart.
- **Table Position** (Top Center, Bottom Right, etc.).
- **Text Size** and **Text Color**.
- **Hide VWAP logic**: VWAP data can be hidden automatically on higher timeframes (e.g., daily or weekly).
- **Enable/disable the VWAP ยฑฯ band lines** (optional visual aid).
---
### ๐ Technical Highlights
- VWAP is recalculated each day using `ta.vwap(hlc3, isNewPeriod, 1)`.
- The band width uses standard deviation and the selected multiplier: `VWAP ยฑ ฯ * multiplier`.
- Table updates dynamically with the new VWAP values each day.
- To **avoid floating-point rounding issues**, `vwapDelta` is rounded before comparison, ensuring correct background color display.
---
### โ Why Use This?
- Keeps your chart **visually clean and readable**.
- Gives **immediate context** to current price action relative to VWAP.
- Helps **discretionary traders** or **scalpers** decide whether price is stretched too far from the mean.
- Easier than tracking multiple ฯ bands manually.
---
### Example Usage:
- On intraday timeframes, you can identify price exhaustion as it hits ยฑ2ฯ or ยฑ3ฯ.
- On a 5-minute chart, if price touches `+3ฯ`, you may consider taking profits on longs.
- On reversal setups, watch for price at `-3ฯ` with bullish divergence.
---
### ๐งฉ Future Enhancements (Optional Ideas)
- Add alerts for when `vwapDelta` crosses thresholds like ยฑ2ฯ or ยฑ3ฯ.
- Let user select the timeframe for VWAP source (e.g., 1H, 5M, etc.).
- Extend to display VWAP on session or weekly basis.
---
Let me know if you want a version of this script formatted and cleaned up for direct TradingView publication (with annotations, credits, and formatting). Would you like that?
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda โ ketahui lebih lanjut di sini.