Indicator · Pine Script v6 · On the chart

Regard Hodler's Profile

by regardhodler· code credited to tradingview-volume-profile

The Regard Hodler's Profile indicator plots a volume profile on the price chart.

View on GitHub

Repaints

GitHub stars3on the repository
Pine versionv6current
Lines of code171
Settings13inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago28 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

171 lines of Pine Script v6 from volume-profile.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

volume-profile.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tradingview-volume-profile

//@version=6
indicator("Regard Hodler's Profile", overlay=true, max_boxes_count=500, max_lines_count=50, max_labels_count=500)

// ── Inputs ──────────────────────────────────────────────────────────────────
lookback        = input.int(200, "Lookback Period", minval=10, maxval=5000)
numRows         = input.int(24, "Number of Rows", minval=4, maxval=100)
profileWidth    = input.int(50, "Profile Width (bars)", minval=10, maxval=200)
valueAreaPercent = input.float(70.0, "Value Area %", minval=50.0, maxval=90.0)

showDelta       = input.bool(true, "Show Buy/Sell Delta")
showLabels      = input.bool(true, "Show Level Labels")
showHVNLVN      = input.bool(true, "Show HVN/LVN")
hvnThreshold    = input.float(75.0, "HVN Threshold %", minval=50, maxval=95)
lvnThreshold    = input.float(25.0, "LVN Threshold %", minval=5, maxval=50)

buyColor        = input.color(color.new(color.green, 40), "Support Color")
sellColor       = input.color(color.new(color.red, 40), "Resistance Color")
pocColor        = input.color(color.yellow, "POC Line Color")
valueAreaBgColor = input.color(color.new(color.blue, 85), "Value Area Color")

// ── Series — must run on every bar for correct state ─────────────────────────
highestHigh  = ta.highest(high, lookback)
lowestLow    = ta.lowest(low, lookback)
// (bar_index used for x-coordinates — no barDuration needed)

// ── Main logic — only on the last bar ───────────────────────────────────────
if barstate.islast
    // Find price range over lookback
    rowHeight   = (highestHigh - lowestLow) / numRows

    if rowHeight > 0
        // Initialize buy/sell volume arrays
        binBuyVol  = array.new_float(numRows, 0.0)
        binSellVol = array.new_float(numRows, 0.0)
        binVol     = array.new_float(numRows, 0.0)

        // Accumulate volume into bins with buy/sell split
        for i = 0 to lookback - 1
            midPrice = (high[i] + low[i]) / 2.0
            bin = math.floor((midPrice - lowestLow) / rowHeight)
            bin := math.min(bin, numRows - 1)
            bin := math.max(bin, 0)
            buyRatio = high[i] != low[i] ? (close[i] - low[i]) / (high[i] - low[i]) : 0.5
            buyRatio := math.max(0.0, math.min(1.0, buyRatio))
            buyV  = volume[i] * buyRatio
            sellV = volume[i] - buyV
            array.set(binBuyVol, bin, array.get(binBuyVol, bin) + buyV)
            array.set(binSellVol, bin, array.get(binSellVol, bin) + sellV)
            array.set(binVol, bin, array.get(binVol, bin) + volume[i])

        // Find max total volume (for scaling) and POC bin
        maxVol  = 0.0
        pocBin  = 0
        totalVol = 0.0

        for i = 0 to numRows - 1
            binTotal = array.get(binVol, i)
            totalVol += binTotal
            if binTotal > maxVol
                maxVol := binTotal
                pocBin := i

        // Calculate Value Area — expand outward from POC
        vaVolume    = array.get(binVol, pocBin)
        vaThreshold = totalVol * (valueAreaPercent / 100.0)
        vaLow       = pocBin
        vaHigh      = pocBin

        while vaVolume < vaThreshold and (vaLow > 0 or vaHigh < numRows - 1)
            upVol   = vaHigh < numRows - 1 ? array.get(binVol, vaHigh + 1) : 0.0
            downVol = vaLow > 0 ? array.get(binVol, vaLow - 1) : 0.0

            if upVol >= downVol and vaHigh < numRows - 1
                vaHigh  += 1
                vaVolume += upVol
            else if vaLow > 0
                vaLow   -= 1
                vaVolume += downVol
            else if vaHigh < numRows - 1
                vaHigh  += 1
                vaVolume += upVol
            else
                break

        // ── Drawing ─────────────────────────────────────────────────────────
        // Clear previous drawings
        aBoxes = box.all
        if array.size(aBoxes) > 0
            for i = 0 to array.size(aBoxes) - 1
                box.delete(array.get(aBoxes, i))

        aLines = line.all
        if array.size(aLines) > 0
            for i = 0 to array.size(aLines) - 1
                line.delete(array.get(aLines, i))

        aLabels = label.all
        if array.size(aLabels) > 0
            for i = 0 to array.size(aLabels) - 1
                label.delete(array.get(aLabels, i))

        // Profile anchors: just right of last bar so it's visible on screen
        rightBar = bar_index + profileWidth + 5
        leftBar  = bar_index + 5

        // Draw volume boxes per bin
        for i = 0 to numRows - 1
            binBottom = lowestLow + i * rowHeight
            binTop    = binBottom + rowHeight
            binTotal  = array.get(binVol, i)

            if binTotal > 0 and maxVol > 0
                totalWidth = math.round(profileWidth * (binTotal / maxVol))

                if showDelta
                    // Stacked buy/sell boxes
                    buyV  = array.get(binBuyVol, i)
                    sellV = array.get(binSellVol, i)
                    sellWidth = math.round(totalWidth * (sellV / binTotal))
                    // Buy box (left portion)
                    if totalWidth - sellWidth > 0
                        box.new(rightBar - totalWidth, binTop, rightBar - sellWidth, binBottom, border_color=buyColor, bgcolor=buyColor)
                    // Sell box (right portion, flush to price axis)
                    if sellWidth > 0
                        box.new(rightBar - sellWidth, binTop, rightBar, binBottom, border_color=sellColor, bgcolor=sellColor)
                else
                    // Single box colored by support/resistance
                    binMid   = binBottom + rowHeight / 2
                    binColor = binMid < close ? buyColor : sellColor
                    box.new(rightBar - totalWidth, binTop, rightBar, binBottom, border_color=binColor, bgcolor=binColor)

        // Draw Value Area shading
        vaPriceBottom = lowestLow + vaLow * rowHeight
        vaPriceTop    = lowestLow + (vaHigh + 1) * rowHeight
        box.new(leftBar, vaPriceTop, rightBar, vaPriceBottom, border_color=color.new(color.blue, 90), bgcolor=valueAreaBgColor)

        // Draw POC line
        pocPrice = lowestLow + (pocBin + 0.5) * rowHeight
        line.new(leftBar, pocPrice, rightBar, pocPrice, color=pocColor, width=2, style=line.style_dashed)

        // Draw VAH and VAL lines
        line.new(leftBar, vaPriceTop, rightBar, vaPriceTop, color=color.new(color.blue, 30), width=1, style=line.style_dashed)
        line.new(leftBar, vaPriceBottom, rightBar, vaPriceBottom, color=color.new(color.blue, 30), width=1, style=line.style_dashed)

        // Draw labels for POC, VAH, VAL
        if showLabels
            label.new(rightBar, pocPrice, "POC", style=label.style_label_left, color=pocColor, textcolor=color.black, size=size.small)
            label.new(rightBar, vaPriceTop, "Resistance", style=label.style_label_left, color=color.new(color.blue, 30), textcolor=color.white, size=size.small)
            label.new(rightBar, vaPriceBottom, "Support", style=label.style_label_left, color=color.new(color.blue, 30), textcolor=color.white, size=size.small)

        // Detect and label HVN/LVN
        if showHVNLVN
            hvnLevel = maxVol * (hvnThreshold / 100.0)
            lvnLevel = maxVol * (lvnThreshold / 100.0)
            hvnCount = 0
            lvnCount = 0

            for i = 0 to numRows - 1
                binTotal = array.get(binVol, i)
                binMid   = lowestLow + (i + 0.5) * rowHeight

                if binTotal >= hvnLevel and i != pocBin and hvnCount < 5
                    label.new(rightBar, binMid, "HV", style=label.style_label_left, color=color.new(color.green, 20), textcolor=color.white, size=size.tiny)
                    hvnCount += 1

                if binTotal <= lvnLevel and binTotal > 0 and lvnCount < 5
                    label.new(rightBar, binMid, "LV", style=label.style_label_left, color=color.new(color.red, 20), textcolor=color.white, size=size.tiny)
                    lvnCount += 1

Overview

Regard Hodler's Profile analyzes the last lookback bars to bin prices and accumulate buy and sell volumes based on candle direction. Stacked green and red bars appear at each price level, with a dashed POC line at the highest volume bin and shaded Value Area. HVN/LVN nodes are labeled per thresholds. Settings control lookback period, row count, profile width, value area percentage, and toggles for delta, labels, and HVN/LVN. All elements overlay on the chart. It repaints on the live bar as the profile updates.

Details

Published by

regardhodler on GitHub

Code credit

tradingview-volume-profile, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Volume, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Lookback Periodint200lookback
Number of Rowsint24numRows
Profile Width (bars)int50profileWidth
Value Area %float70.0valueAreaPercent
Show Buy/Sell DeltabooltrueshowDelta
Show Level LabelsbooltrueshowLabels
Show HVN/LVNbooltrueshowHVNLVN
HVN Threshold %float75.0hvnThreshold
LVN Threshold %float25.0lvnThreshold
Support Colorcolorcolor.new(color.green, 40)buyColor
Resistance Colorcolorcolor.new(color.red, 40)sellColor
POC Line Colorcolorcolor.yellowpocColor
Show all 13 settings
SettingTypeDefaultVariable
Value Area Colorcolorcolor.new(color.blue, 85)valueAreaBgColor
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

This overlay indicator draws a fixed-range volume profile on the price chart, splitting traded activity into up and down volume at each price level. It also plots a sentiment profile, a developing point of control, and value-area high and low around a configur

Indicator v5 VolumeSupport & resistance
Updated 2 months ago · MIT GitHub repository of Volume Profile and Indicator by DGT

MGIC-tracker

by Allen1212
303 stars

The MGIC-tracker is a TradingView indicator that overlays ARK Invest trade records onto stock price charts. It plots buy and sell labels at the exact timestamp of each transaction, showing share volume and ETF weight. Users select a specific ETF type via setti

Indicator v4 Support & resistanceVolume
Updated 2 years ago · None stated GitHub repository of MGIC-tracker
218 stars

Comprehensive Volume Profile is an overlay indicator that calculates and plots volume distribution across specified time ranges such as daily sessions, weekly, monthly, or custom bar lengths. It identifies key structural price levels including the Point of Con

Indicator v6 VolumeSupport & resistance
Updated 3 months ago · None stated GitHub repository of Comprehensive Volume Profile

Moon Dev GEX Arrows

by moondevonyt
92 stars

This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Arrows

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers