OPEN-SOURCE SCRIPT
ที่อัปเดต: VWAP Session and NY Cash

Auto Anchored VWAPs with Label options
Session starts at 1800 EST
Cash Open or NY Session starts 0930 EST
Session starts at 1800 EST
Cash Open or NY Session starts 0930 EST
Release Note
Auto Anchored VWAPs with Label optionsSession starts at 1800 EST
Cash Open or NY Session starts 0930 EST
18 Aug
- Hides the Session VWAP when switching to RTH
Release Note
Major Bug Fixes- Resolved missing Session VWAP Plots over 5M Timeframe
- Removed stray rendering of cVWAP in higher timeframes like the Daily and higher
- Issues with commons
Issues were due to detection methods of session start and end times
Changes
Session VWAP now renders
- Daily timeframe with the Weekly anchor
- Weekly timeframe with the Monthly anchor
Release Note
# VWAP Session and NY Cash## Indicator Description
This indicator displays two Volume Weighted Average Price (VWAP) lines designed specifically for US equity markets:
**NY VWAP (Cash Session VWAP)** - Calculates VWAP for regular trading hours only (9:30 AM - 4:00 PM ET). Resets daily at market open. This is the VWAP that institutional traders reference for the cash session.
**Session VWAP** - Calculates VWAP for the full trading session including pre-market and after-hours (6:00 PM - 4:00 PM ET next day). Only displays when extended hours data is available on the chart.
The Session VWAP also supports standard deviation bands for identifying potential support/resistance levels.
---
## User Guide
### Quick Start
1. Add the indicator to your chart
2. Both VWAPs will appear automatically on intraday charts
3. Session VWAP only appears if your chart has extended hours enabled (right-click chart → Settings → Symbol → Extended Hours)
### Settings
#### Calculation
| Setting | Default | Description |
|---------|---------|-------------|
| Use 5-min data for precision | On | On chart timeframes above 5 minutes, calculates VWAP using 5-minute bars for more accurate values. Prevents VWAP drift on higher timeframe charts (H1, H4, etc.). |
#### NY VWAP
| Setting | Default | Description |
|---------|---------|-------------|
| Color | Green | Line color for NY VWAP |
| Width | 1 | Line thickness |
| Style | Solid | Line style (Solid/Dashed/Dotted) |
| Show Label | On | Display price label at end of line |
| Label | "NYVWAP" | Custom label text |
| Offset | 0 | Horizontal offset for label position |
| Label Size | Normal | Text size (Tiny/Small/Normal/Large/Huge) |
| Show in Price Scale | On | Display value on right price axis |
#### Session VWAP
| Setting | Default | Description |
|---------|---------|-------------|
| Enabled | On | Master toggle. Disable to skip Session VWAP entirely. Useful when using TradingView's built-in VWAP separately. |
| Color | Bright Green | Line color for Session VWAP |
| Width | 2 | Line thickness |
| Style | Dashed | Line style (Solid/Dashed/Dotted) |
| Show Label | On | Display price label at end of line |
| Label | "VWAP" | Custom label text |
| Offset | 0 | Horizontal offset for label position |
| Label Size | Normal | Text size (Tiny/Small/Normal/Large/Huge) |
| Show in Price Scale | On | Display value on right price axis |
#### Session VWAP Bands
Three independent standard deviation bands are available. Each band has identical settings:
| Setting | Description |
|---------|-------------|
| Band Std Dev #N | Enable/disable this band |
| Multiplier | Number of standard deviations (default: 1.0, 2.0, 3.0) |
| Style | Line style (Solid/Dashed/Dotted) |
| Line | Color for the band lines |
| Fill | Color for the fill between upper and lower bands |
| Price Scale | Show band values on the right price axis |
### Timeframe Behavior
| Chart Timeframe | NY VWAP | Session VWAP |
|-----------------|---------|--------------|
| Intraday (≤5min) | Calculated from chart bars | Calculated from chart bars |
| Intraday (>5min) | Calculated from 5-min bars* | Calculated from 5-min bars* |
| Daily | Not shown | Weekly VWAP |
| Weekly | Not shown | Monthly VWAP |
*When "Use 5-min data for precision" is enabled (default)
### Tips
- **For futures traders**: The NY VWAP (9:30-16:00) matches the cash session that institutions use for benchmarking
- **For higher timeframes**: Keep "Use 5-min data for precision" enabled to avoid VWAP drift
- **To reduce chart clutter**: Disable Session VWAP if you only need the cash session VWAP
- **Standard deviation bands**: Common setups use 1, 2, and 3 standard deviations for mean reversion strategies
---
## Changelog
### Version 2.0
#### New Features
**Calculation Settings**
- **Use 5-min data for precision** - Calculates VWAP using 5-minute bars on higher timeframe charts (>5min) for accurate values. Enabled by default. Prevents VWAP drift that occurs when only chart-timeframe bars are used.
**Session VWAP Bands**
- Added 3 configurable standard deviation bands around Session VWAP
- Each band has independent enable toggle, multiplier, line style, line color, fill color, and price scale visibility
- Default multipliers: 1.0, 2.0, 3.0 standard deviations
- Band values hidden from data window to reduce clutter
**Session VWAP Toggle**
- Added "Enabled" toggle to completely disable Session VWAP calculation and rendering
- Useful when using TradingView's built-in VWAP indicator separately
#### Improvements
- Reorganized settings into logical groups with inline controls
- Added independent label controls for NY VWAP and Session VWAP
- Added "Show in Price Scale" option for both VWAPs
- Added customizable line styles (Solid/Dashed/Dotted)
- Added volume validation with error message when no volume data available
- Improved label positioning with configurable offsets
#### Technical Changes
- Implemented manual VWAP calculation for NY VWAP HD mode with proper 9:30 AM reset
- Uses `request.security_lower_tf()` with FIFO array pattern to accumulate intrabar data
- Session VWAP HD uses `ta.vwap()` anchored at daily change
- Repaint-safe: Historical bars are stable once closed; current bar updates in realtime (expected VWAP behavior)
### Version 1.0
- Initial release
- Dual VWAP display: NY Cash Session (9:30-16:00) and Full Session (including extended hours)
- Automatic detection of extended hours data
- Smooth transitions at market open using dual-instance swap mechanism
Release Note
Bug fixes to logic, bringing htf charts closer to the 5 minute valuesสคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน