Indicator · Pine Script v6 · On the chart

HVC Watcher

by major

This indicator identifies High Volume Close (HVC) and Highest Volume Ever (HVE) events directly on the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code126
Settings18inputs
LicenceApache-2.0
Last update3 months ago29 Jul 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

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.

Details

Published by

major on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Volume, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

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

SettingTypeDefaultVariable
Volume SMA Lengthint20sma_length
HVC Multiplier Thresholdfloat3.0hvc_threshold
Show HVE Markersboolfalseshow_hve_markers
HVE Colorcolorcolor.greencolor_hve
HVC Colorcolorcolor.orangecolor_hvc
Shape Stylestringcirclesshape_style
Show HVC Zonesbooltrueshow_zones
Extend Zones Rightboolfalsezone_extend_right
Zone Length (bars)int90zone_length
Zone Colorcolorcolor.bluezone_color
Zone Fill Transparency (%)int95zone_transparency
Zone Edge Transparency (%)int80zone_edge_transparency
Show all 18 settings
SettingTypeDefaultVariable
Show Volume Multiplier Labelsboolfalseshow_multiplier_labels
Multiplier Label Backgroundcolorcolor.orangemultiplier_label_color
Multiplier Label Textcolorcolor.blackmultiplier_text_color
Show Current Bar Multiplierboolfalseshow_current_multiplier
Current Bar Label Backgroundcolorcolor.new(color.blue, 50)current_label_color
Current Bar Label Textcolorcolor.whitecurrent_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.

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