OPEN-SOURCE SCRIPT
Volume Profile Levels - POC, Value Area, HVP/LVP

Volume Profile Levels — POC, Value Area, HVP/LVP
OVERVIEW
This indicator builds a fixed-range volume profile over a user-defined lookback window and extracts its key structural levels as horizontal lines: the Point of Control (POC), the Value Area boundaries (VAH/VAL), and local High/Low Volume Peaks (HVP/LVP). The goal is not the histogram itself but the levels it produces — clean, alertable support/resistance derived from where volume actually traded.
HOW IT WORKS
Volume distribution. For each bar in the lookback window, its volume is distributed evenly across the price bins that the bar's high–low range spans. The full range of the window is divided into a configurable number of rows.
POC and Value Area. The POC is the bin with the highest accumulated volume. The Value Area is expanded outward from the POC, adding the larger neighboring bin at each step, until the target percentage of total volume (70% by default) is covered.
HVP / LVP detection. A bin qualifies as a High Volume Peak when it is a local maximum and exceeds the bin average by a configurable multiplier. A Low Volume Peak is a local minimum below the average by a configurable multiplier. Up to six levels of each type are shown, ranked by volume.
MTF mode. The profile can be calculated on a higher timeframe while displayed on the current chart. In MTF mode the lookback is counted in higher-timeframe bars, and the histogram can be hidden automatically to keep the chart readable while the levels remain.
FEATURES
- Fixed-range volume profile with adjustable lookback, row count, and Value Area percentage
- POC, VAH/VAL, HVP, and LVP levels drawn as lines across the analyzed range
- Optional profile histogram on the right or left side of the chart
- Higher-timeframe profile calculation with automatic histogram hiding
- Three label modes: full text labels, minimal dots, or both
- Diagnostics table showing the profile's range, bin size, total volume, and level counts
ALERTS
All alerts use the generic alert() function: create one alert on the indicator with "Any alert() function call" and enable the events you want in the settings.
- POC / VAH / VAL cross (close crossing the level)
- HVP / LVP level cross (optional; can be noisy)
- SR Flip: after a level is broken, the alert fires if price retests the level with a wick within a configurable bar window while the close holds the breakout direction
- Value Area entry / exit
NOTES
- The profile is an approximation: volume is split evenly across each bar's range, as tick-level data is not available in Pine. Results depend on the chart timeframe and the lookback setting.
- Levels are recalculated on every bar, so they shift as the window rolls forward. This is a rolling analysis tool, not a fixed anchored profile.
- Works on any symbol that provides volume data.
OVERVIEW
This indicator builds a fixed-range volume profile over a user-defined lookback window and extracts its key structural levels as horizontal lines: the Point of Control (POC), the Value Area boundaries (VAH/VAL), and local High/Low Volume Peaks (HVP/LVP). The goal is not the histogram itself but the levels it produces — clean, alertable support/resistance derived from where volume actually traded.
HOW IT WORKS
Volume distribution. For each bar in the lookback window, its volume is distributed evenly across the price bins that the bar's high–low range spans. The full range of the window is divided into a configurable number of rows.
POC and Value Area. The POC is the bin with the highest accumulated volume. The Value Area is expanded outward from the POC, adding the larger neighboring bin at each step, until the target percentage of total volume (70% by default) is covered.
HVP / LVP detection. A bin qualifies as a High Volume Peak when it is a local maximum and exceeds the bin average by a configurable multiplier. A Low Volume Peak is a local minimum below the average by a configurable multiplier. Up to six levels of each type are shown, ranked by volume.
MTF mode. The profile can be calculated on a higher timeframe while displayed on the current chart. In MTF mode the lookback is counted in higher-timeframe bars, and the histogram can be hidden automatically to keep the chart readable while the levels remain.
FEATURES
- Fixed-range volume profile with adjustable lookback, row count, and Value Area percentage
- POC, VAH/VAL, HVP, and LVP levels drawn as lines across the analyzed range
- Optional profile histogram on the right or left side of the chart
- Higher-timeframe profile calculation with automatic histogram hiding
- Three label modes: full text labels, minimal dots, or both
- Diagnostics table showing the profile's range, bin size, total volume, and level counts
ALERTS
All alerts use the generic alert() function: create one alert on the indicator with "Any alert() function call" and enable the events you want in the settings.
- POC / VAH / VAL cross (close crossing the level)
- HVP / LVP level cross (optional; can be noisy)
- SR Flip: after a level is broken, the alert fires if price retests the level with a wick within a configurable bar window while the close holds the breakout direction
- Value Area entry / exit
NOTES
- The profile is an approximation: volume is split evenly across each bar's range, as tick-level data is not available in Pine. Results depend on the chart timeframe and the lookback setting.
- Levels are recalculated on every bar, so they shift as the window rolls forward. This is a rolling analysis tool, not a fixed anchored profile.
- Works on any symbol that provides volume data.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。