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
126 lines of Pine Script v6 from hvc_watcher/hvc_watcher.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.
hvc_watcher.pine
// Copyright 2025 Major Hayden
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//@version=6
indicator('HVC Watcher', shorttitle = 'HVC Watch', overlay = true, max_lines_count = 200, max_labels_count = 500)
// ═══════════════════════════════════════════════════════════════
// INPUTS
// ═══════════════════════════════════════════════════════════════
// Volume settings
sma_length = input.int(20, title = 'Volume SMA Length', minval = 1, group = 'Volume Settings', tooltip = 'Number of bars used to calculate the volume simple moving average (SMA)')
hvc_threshold = input.float(3.0, title = 'HVC Multiplier Threshold', minval = 1.0, step = 0.1, group = 'Volume Settings', tooltip = 'Volume must be at least this many times the SMA to trigger a High Volume Close (HVC)')
// Marker settings
show_hve_markers = input.bool(false, title = 'Show HVE Markers', group = 'Markers', tooltip = 'Show Highest Volume Ever (HVE) markers. When disabled, bars that are both HVC and HVE will still display as HVC.')
color_hve = input.color(color.green, title = 'HVE Color', group = 'Markers', tooltip = 'Color for Highest Volume Ever (HVE) markers - bars with the highest volume seen on the chart')
color_hvc = input.color(color.orange, title = 'HVC Color', group = 'Markers', tooltip = 'Color for High Volume Close (HVC) markers - bars where volume exceeds the SMA threshold')
shape_style = input.string('circles', title = 'Shape Style', options = ['circles', 'triangleup', 'diamond', 'cross', 'xcross'], group = 'Markers')
// Zone settings
show_zones = input.bool(true, title = 'Show HVC Zones', group = 'Zones', tooltip = 'Draw horizontal zones marking the high/low range of HVC bars')
zone_extend_right = input.bool(false, title = 'Extend Zones Right', group = 'Zones', tooltip = 'Extend zones to the right edge of the chart (useful for support/resistance). When disabled, zones have a fixed length.')
zone_length = input.int(90, title = 'Zone Length (bars)', minval = 1, group = 'Zones', tooltip = 'Number of bars to extend zones when "Extend Zones Right" is disabled')
zone_color = input.color(color.blue, title = 'Zone Color', group = 'Zones')
zone_transparency = input.int(95, title = 'Zone Fill Transparency (%)', minval = 0, maxval = 100, group = 'Zones')
zone_edge_transparency = input.int(80, title = 'Zone Edge Transparency (%)', minval = 0, maxval = 100, group = 'Zones')
// Label settings
show_multiplier_labels = input.bool(false, title = 'Show Volume Multiplier Labels', group = 'Labels', tooltip = 'Display the volume multiplier (e.g., 5x) next to HVC bars')
multiplier_label_color = input.color(color.orange, title = 'Multiplier Label Background', group = 'Labels')
multiplier_text_color = input.color(color.black, title = 'Multiplier Label Text', group = 'Labels')
show_current_multiplier = input.bool(false, title = 'Show Current Bar Multiplier', group = 'Labels', tooltip = 'Display real-time volume multiplier for the current (incomplete) bar')
current_label_color = input.color(color.new(color.blue, 50), title = 'Current Bar Label Background', group = 'Labels')
current_text_color = input.color(color.white, title = 'Current Bar Label Text', group = 'Labels')
// ═══════════════════════════════════════════════════════════════
// CALCULATIONS
// ═══════════════════════════════════════════════════════════════
volume_sma = ta.sma(volume, sma_length)
volume_multiplier = volume_sma > 0 ? volume / volume_sma : 0
// Detection flags
var float hve_threshold = 0
hve_threshold := math.max(hve_threshold, nz(volume[1], 0))
is_hve = volume > hve_threshold and volume > 0
is_hvc = volume >= volume_sma * hvc_threshold
// Determine which markers to show (HVE takes priority over HVC to avoid overlap)
show_hve = show_hve_markers and is_hve
show_hvc = is_hvc and not show_hve
// Map shape style string to plotshape constant
getShape(style) =>
switch style
'circles' => shape.circle
'triangleup' => shape.triangleup
'diamond' => shape.diamond
'cross' => shape.cross
'xcross' => shape.xcross
=> shape.circle
selected_shape = getShape(shape_style)
// ═══════════════════════════════════════════════════════════════
// RENDERING
// ═══════════════════════════════════════════════════════════════
plotshape(series = show_hve, location = location.abovebar, style = selected_shape, size = size.tiny, color = color_hve, title = 'HVE (Highest Volume Ever)')
plotshape(series = show_hvc, location = location.abovebar, style = selected_shape, size = size.tiny, color = color_hvc, title = 'HVC (High Volume Close)')
// Volume multiplier labels
if show_multiplier_labels and is_hvc and volume_sma > 0
multiplier_rounded = math.round(volume_multiplier)
label_text = str.tostring(multiplier_rounded) + "x"
label.new(bar_index, close, label_text,
color = multiplier_label_color,
textcolor = multiplier_text_color,
style = label.style_label_right,
size = size.normal)
// HVC zones
if show_zones and is_hvc
fillColor = color.new(zone_color, zone_transparency)
edgeColor = color.new(zone_color, zone_edge_transparency)
zone_end = zone_extend_right ? bar_index + 1 : bar_index + zone_length
zone_extend = zone_extend_right ? extend.right : extend.none
topLine = line.new(bar_index, high, zone_end, high, extend = zone_extend, color = edgeColor)
bottomLine = line.new(bar_index, low, zone_end, low, extend = zone_extend, color = edgeColor)
linefill.new(topLine, bottomLine, color = fillColor)
// Current bar multiplier
if show_current_multiplier and barstate.islast and volume_sma > 0
current_mult_text = str.tostring(math.round(volume_multiplier)) + "x"
var label current_label = na
label.delete(current_label)
current_label := label.new(bar_index, low, current_mult_text,
color = current_label_color,
textcolor = current_text_color,
style = label.style_label_upper_left,
size = size.normal)
// ═══════════════════════════════════════════════════════════════
// ALERTS
// ═══════════════════════════════════════════════════════════════
alertcondition(is_hve, title = 'HVE', message = 'Highest Volume Ever detected on {{ticker}}')
alertcondition(is_hvc, title = 'HVC', message = 'High Volume Close detected on {{ticker}}')
alertcondition(is_hve or is_hvc, title = 'HVE or HVC', message = 'HVE or HVC detected on {{ticker}}')
// Display current values in data window
plot(volume, title = 'Volume', display = display.data_window)
plot(volume_sma, title = 'Volume SMA', display = display.data_window)
plot(hve_threshold, title = 'HVE Threshold', display = display.data_window)
Overview
HVC Watcher calculates a volume simple moving average and detects bars where volume exceeds a configured multiple of that average. Detected bars can display markers, optional volume multiplier labels, and horizontal price zones across the bar's high-low range. Users can adjust the volume threshold, zone lengths, visual styles, and rightward zone extensions for support and resistance analysis.
High Volume Close threshold detection based on volume SMA
Highest Volume Ever marker identification
Horizontal price zones spanning high and low ranges
Configurable zone extensions and transparency settings
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Volume SMA Length
int
20
sma_length
HVC Multiplier Threshold
float
3.0
hvc_threshold
Show HVE Markers
bool
false
show_hve_markers
HVE Color
color
color.green
color_hve
HVC Color
color
color.orange
color_hvc
Shape Style
string
circles
shape_style
Show HVC Zones
bool
true
show_zones
Extend Zones Right
bool
false
zone_extend_right
Zone Length (bars)
int
90
zone_length
Zone Color
color
color.blue
zone_color
Zone Fill Transparency (%)
int
95
zone_transparency
Zone Edge Transparency (%)
int
80
zone_edge_transparency
Show all 18 settings
Setting
Type
Default
Variable
Show Volume Multiplier Labels
bool
false
show_multiplier_labels
Multiplier Label Background
color
color.orange
multiplier_label_color
Multiplier Label Text
color
color.black
multiplier_text_color
Show Current Bar Multiplier
bool
false
show_current_multiplier
Current Bar Label Background
color
color.new(color.blue, 50)
current_label_color
Current Bar Label Text
color
color.white
current_text_color
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