DIY Volume Profile is an indicator that calculates the point of control and value area using volume distribution across price rows based on the last specified lookback bars.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
79 lines of Pine Script v6 from scripts/volume-profile.pine.txt, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.
volume-profile.pine.txt
//@version=6
indicator("DIY Volume Profile", overlay = true, max_bars_back = 500)
lookback = input.int(150, "Bars in the profile", minval = 20, maxval = 400)
rows = input.int(24, "Price rows", minval = 6, maxval = 40)
vaPct = input.float(70, "Value area %", minval = 10, maxval = 95)
maxW = input.int(24, "Widest row, in blocks", minval = 4, maxval = 40)
var array<float> bins = array.new_float(rows, 0)
float poc = na
float vah = na
float val = na
int pocRow = na
int vaLo = na
int vaHi = na
hiP = ta.highest(high, lookback)
loP = ta.lowest(low, lookback)
step = (hiP - loP) / rows
inWindow = bar_index >= last_bar_index - lookback + 1
ready = inWindow and step > 0
if ready
array.fill(bins, 0)
for i = 0 to lookback - 1
h = high[i]
l = low[i]
v = nz(volume[i])
a = math.min(rows - 1, math.max(0, math.floor((l - loP) / step)))
b = math.min(rows - 1, math.max(0, math.floor((h - loP) / step)))
for r = a to b
rLo = loP + r * step
part = math.min(h, rLo + step) - math.max(l, rLo)
share = h > l ? math.max(0, part) / (h - l) : 1.0
array.set(bins, r, array.get(bins, r) + v * share)
if ready
pocRow := array.indexof(bins, array.max(bins))
poc := loP + (pocRow + 0.5) * step
if ready
target = array.sum(bins) * vaPct / 100
acc = array.get(bins, pocRow)
vaLo := pocRow
vaHi := pocRow
while acc < target and (vaLo > 0 or vaHi < rows - 1)
up = vaHi < rows - 1 ? array.get(bins, vaHi + 1) : -1.0
dn = vaLo > 0 ? array.get(bins, vaLo - 1) : -1.0
if up >= dn
vaHi += 1
acc += up
else
vaLo -= 1
acc += dn
vah := loP + (vaHi + 1) * step
val := loP + vaLo * step
pH = plot(vah, "Value area high", color.new(color.teal, 0), 1,
plot.style_linebr)
pL = plot(val, "Value area low", color.new(color.teal, 0), 1,
plot.style_linebr)
fill(pH, pL, color.new(color.teal, 90), "Value area")
plot(poc, "POC", color.new(color.orange, 0), 3, plot.style_linebr)
var table prof = table.new(position.top_right, 2, 40,
frame_width = 1, frame_color = color.gray)
if barstate.islast and ready
top = array.max(bins)
for r = 0 to rows - 1
w = top > 0 ? math.round(array.get(bins, r) / top * maxW) : 0
blocks = str.repeat("█", w)
inVA = r >= vaLo and r <= vaHi
c = r == pocRow ? color.orange : inVA ? color.teal : color.gray
px = str.tostring(loP + (r + 0.5) * step, format.mintick)
row = rows - 1 - r
table.cell(prof, 0, row, px, text_color = c,
text_size = size.tiny)
table.cell(prof, 1, row, blocks, text_color = c,
text_size = size.tiny, text_halign = text.align_left)
Overview
DIY Volume Profile plots horizontal lines for the value area high and low along with the POC on the price chart. A table is drawn in the top right showing price levels and block representations of volume per row. Settings control the bars in profile, price rows, value area percentage, and widest row width. It updates the profile as new bars complete and draws directly on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bars in the profile
int
150
lookback
Price rows
int
24
rows
Value area %
float
70
vaPct
Widest row, in blocks
int
24
maxW
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.
This indicator plots a session VWAP of the typical price on the price chart. It marks an up triangle under a bar when close crosses above VWAP and a down triangle above a bar when close crosses below it. A star pinned at the top of the pane marks bars whose vo
This overlay indicator builds a horizontal momentum profile over a chosen lookback. It splits price into rows and plots the average WaveTrend of each zone as a bar colored by direction, plus an optional MFI reference band that stays gray when real trade volume
The Holographic Market Microstructure indicator overlays market structure and smart money insights directly on the price chart. It identifies liquidity voids, order flow imbalances, accumulation zones, price and volume divergences, and fractal market structure
This indicator builds a frozen volume profile over a fixed, half-open timestamp range and draws it on the price chart. It aggregates one-minute source bars into output rows sized by a chosen tick count, marks a configurable value-area percentage, and can plot
This overlay indicator draws an on-chart depth-of-market table that splits volume at each price tick into estimated buy volume, sell volume, delta, and session volume. Growing text bars compare buyers and sellers, and recent bars approximate resting bid and as
This indicator overlays an order flow intelligence suite directly on the price chart. It renders a liquidity heatmap across configured price zones, alongside an on-chart information panel displaying volume delta, cumulative volume delta, a momentum compass bas