OPEN-SOURCE SCRIPT

Rolling Volume Structure: HVN & Sentiment

481
Title:
Rolling Volume Structure: HVN & Sentiment

Description:
This indicator visualizes the distribution of volume over price levels for a user-defined rolling period. It is designed to identify structural market nodes (HVN/LVN) and correlate them with Pivot Points to filter out market noise.

NOTE: This script utilizes a mathematical array binning algorithm to calculate the profile efficiently on the chart timeframe, avoiding the runtime timeouts often associated with standard iterative volume profiles.

How it works (Technical Methodology)
Binning Algorithm: The script calculates the price range (Highest High - Lowest Low) of the lookback period and divides it into a fixed number of vertical bins defined by the Resolution input.

Volume Allocation: It iterates through historical bars once. The volume of each bar is assigned to the corresponding price bin based on the bar's closing price.

Sentiment Approximation: Since tick-level Bid/Ask data is not available for historical bars in standard Pine Script strategies, this indicator estimates directional volume based on candle polarity:

If Close > Open: Volume is categorized as "Up Volume" (Buying Sentiment).

If Close < Open: Volume is categorized as "Down Volume" (Selling Sentiment).

Disclaimer: This is a standard approximation for structural analysis and does not represent true tick-data delta.

Why this Combination? (Originality & Synergy)
This script addresses the problem of validating structural levels. Traders often use Pivots and Volume Profiles separately. This script combines them programmatically to provide context:

Pivot Confluence: A Pivot Point is only plotted if it aligns with significant volume structure.

HVN Validation: A pivot occurring within a High Volume Node (HVN) suggests a high-liquidity reversal zone, whereas a pivot in a Low Volume Node (LVN) may indicate a liquidity void or a "weak" high/low.

The Dashboard summarizes these metrics (Position relative to Value Area, Net Sentiment, and Trend), removing the need for multiple separate indicators.

Educational Use for Beginners
If you are new to Volume Profile, think of the market structure in these simple terms:

Value Area (VA): This is the "Fair Price" zone where 70% of trading happened. If price is inside here, the market is balanced. If price breaks out, it may be starting a trend.

HVN (High Volume Nodes - Colored Boxes): Think of these as "Traffic Jams". Price often slows down, bounces, or gets stuck here because there are many orders. They act as Support or Resistance.

LVN (Low Volume Nodes - Gray Strips): Think of these as "Empty Highways". Because there is little volume here, price tends to move through these zones very quickly to get to the next HVN.

Features
HVN (High Volume Nodes): Colored boxes highlighting areas of high accumulation.

LVN (Low Volume Nodes): Gray strips highlighting gaps or acceleration zones.

Value Area (VA): Displays the VAH, VAL, and PoC (Point of Control).

Volume-Filtered Pivots: Plots pivots only when supported by the profile structure.

Sentiment Coloring: The profile bins are colored based on the net bullish/bearish candle volume.

Settings
Rolling Period: The lookback window size (default 150 bars).

Resolution: Precision of the profile bins (higher = more detail, lower = smoother).

HVN Thresholds: Percentage of PoC volume required to identify a node.

Global Text Size: Adjusts labels and dashboard for 4K or standard screens.

Credits: The core binning logic is adapted from generic open-source array management concepts for custom volume profiles.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.