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
103 lines of Pine Script v4 from profile.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.
profile.pine
//@version=4
study("Poor man's volume profile", "PMVolProf", overlay=true, max_bars_back={{max_bars_back}})
block_size = input({{block_size}}, "Bars in profile block", minval=10, maxval={{max_bars_back}})
visual_row_width = input({{visual_row_width}}, "Visual row width", minval=10)
show_peaks = input(true, "Show peaks")
use_custom_volume_source = input(false, "Use custom volume source")
volume_source_symbol = input("", "Custom volume source symbol", input.symbol)
BOUNDS_COLOR = color.{{profile_color}}
PROFILE_COLOR = color.new(color.{{profile_color}}, 50)
PEAK_COLOR = color.new(color.{{peak_color}}, 50)
custom_volume = use_custom_volume_source ? security(volume_source_symbol, timeframe.period, volume, lookahead=barmerge.lookahead_on) : volume
////
// Calculate profile
///
block_high = highest(high, block_size)
block_low = lowest(low, block_size)
float highest_row_value = 0
{% for n in range(n_rows) -%}
float row{{n}}_price = na
int row{{n}}_width = 0
float row{{n}}_value = 0.0
row{{n}}_is_peak = false
{% endfor %}
if barstate.islast
block_height = block_high - block_low
row_height = block_height / {{n_rows}}
{% for n in range(n_rows) -%}
row{{n}}_low = block_low + row_height * {{n}}
row{{n}}_high = block_low + row_height * {{n+1}}
{% endfor %}
for i = 0 to block_size + 1
n_rows_affected = 0
{% for n in range(n_rows) -%}
bar_row{{n}}_value = 0.0
if low[i] < row{{n}}_high and high[i] > row{{n}}_low
bar_row{{n}}_value := nz(custom_volume[i])
n_rows_affected := n_rows_affected + 1
{% endfor %}
{% for n in range(n_rows) -%}
row{{n}}_value := row{{n}}_value + (n_rows_affected != 0 ? bar_row{{n}}_value / n_rows_affected : 0)
{% endfor %}
{% for n in range(n_rows) -%}
highest_row_value := max(highest_row_value, row{{n}}_value)
{% endfor %}
{% for n in range(n_rows) -%}
row{{n}}_price := (row{{n}}_low + row{{n}}_high ) / 2
row{{n}}_width := floor(visual_row_width * row{{n}}_value / highest_row_value)
{% endfor %}
{% for n in range(n_rows) -%}
if {% for m in range([n-peak_size, 0]|max, [n+peak_size+1, n_rows]|min) | reject("eq", n) -%}
{%- if not loop.first %} and {% endif -%}
row{{n}}_value >= row{{m}}_value
{%- endfor %}
row{{n}}_is_peak := true
{% endfor %}
////
// Draw profile
///
var int first_bar_time = time
if barstate.isfirst
first_bar_time := time
var line block_high_line = line.new(bar_index, high, bar_index, high, color=BOUNDS_COLOR)
var line block_low_line = line.new(bar_index, low, bar_index, low, color=BOUNDS_COLOR)
{% for n in range(n_rows) -%}
var label row{{n}}_label = label.new(time_close, close, "", xloc=xloc.bar_time, yloc=yloc.price, color=PROFILE_COLOR, style=label.style_label_left, size=size.auto)
{% endfor %}
if barstate.islast
line.set_xloc(block_high_line, max(time[block_size], first_bar_time), time_close, xloc.bar_time)
line.set_y1(block_high_line, block_high)
line.set_y2(block_high_line, block_high)
line.set_xloc(block_low_line, max(time[block_size], first_bar_time), time_close, xloc.bar_time)
line.set_y1(block_low_line, block_low)
line.set_y2(block_low_line, block_low)
{% for n in range(n_rows) -%}
row{{n}}_text = ""
for i = 0 to row{{n}}_width + 1
row{{n}}_text := row{{n}}_text + "#"
row{{n}}_color = show_peaks and row{{n}}_is_peak ? PEAK_COLOR : PROFILE_COLOR
label.set_x(row{{n}}_label, time_close)
label.set_y(row{{n}}_label, row{{n}}_price)
label.set_color(row{{n}}_label, row{{n}}_color)
label.set_textcolor(row{{n}}_label, row{{n}}_color)
label.set_text(row{{n}}_label, row{{n}}_text)
{% endfor %}
Overview
Poor Man's Volume Profile divides the high-low price range of the block into discrete rows, distributes bar volume across overlapping rows, and visually plots the profile using text labels. It can optional highlight volume peaks and fetch volume from a custom symbol source. The calculation renders exclusively on the live bar and updates dynamically, and fetching external symbol volume utilizes lookahead.
Volume profile calculation over configurable bar blocks
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bars in profile block
input
{{block_size}}
block_size
Visual row width
input
{{visual_row_width}}
visual_row_width
Show peaks
bool
true
show_peaks
Use custom volume source
bool
false
use_custom_volume_source
Custom volume source symbol
symbol
volume_source_symbol
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 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
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
This overlay indicator marks call and put setups from EMAs, RSI, MACD, and a SPY volume ratio. A call needs higher highs, RSI above its minimum, rising MACD, above-average proxy volume, and a rising trend EMA; a put reverses those tests. Early markers use an E
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
This indicator plots two Hull moving averages on the price chart, one of the selected price and one of close, and optionally smooths both with a Kahlman filter. It fills the space between them and marks buy and sell labels when they cross, provided scaled volu
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