Indicator · Pine Script v6 · On the chart

HTF Candle Volume Thermometer [ChartPrime]

by regalouisei· code credited to ChartPrime

The HTF Candle Volume Thermometer indicator renders higher-timeframe candles on the price chart overlaid with volume heatmaps.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code103
Settings7inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 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

103 lines of Pine Script v6 from pinescript/editors_picks/htf-candle-volume-thermometer-chartprime.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

htf-candle-volume-thermometer-chartprime.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ChartPrime

//@version=6
indicator("HTF Candle Volume Thermometer [ChartPrime]", overlay = true, max_boxes_count = 500, max_bars_back = 1000)


// --------------------------------------------------------------------------------------------------------------------}
// 𝙐𝙎𝙀𝙍 𝙄𝙉𝙋𝙐𝙏𝙎
// --------------------------------------------------------------------------------------------------------------------{
timeframe = input.timeframe("D")
resolution = input.string("Mid", "Resolution", ["High", "Mid", "Low"])
color_up = input.color(color.lime, "Bull/Bear", inline = "col_candle")
color_dn = input.color(color.red, "", inline = "col_candle")
transp  = input.int(80, "", inline = "col_candle")
color_heat = input.color(color.yellow, "Heat/Max", inline = "map")
color_poc = input.color(color.red, "", inline = "map")


// --------------------------------------------------------------------------------------------------------------------}
// 𝙄𝙉𝘿𝙄𝘾𝘼𝙏𝙊𝙍 𝘾𝘼𝙇𝘾𝙐𝙇𝘼𝙏𝙄𝙊𝙉𝙎
// --------------------------------------------------------------------------------------------------------------------{

close_htf = request.security(syminfo.tickerid, timeframe, close[1], lookahead = barmerge.lookahead_on)
open_htf = request.security(syminfo.tickerid, timeframe, open[1], lookahead = barmerge.lookahead_on)

time_change = timeframe.change(timeframe)

// Declare arrays to store high/low values during each timeframe period
var array<float> loww = array.new<float>()
var array<float> highh = array.new<float>()

var float H = na
var float L = na
var int index = na

// Dynamic array for bin volumes
var array<float> bin_volumes = array.new<float>()

if time_change
    index := bar_index
    highh.clear()
    loww.clear()
    bin_volumes.clear()  // Reset volume storage

if not time_change
    highh.push(high)
    H := array.max(highh)

    loww.push(low)
    L := array.min(loww)

// Step size based on ATR (dividing into segments)

div = switch resolution
    "High" => 5
    "Mid" => 3
    "Low" => 1

step = ta.atr(200) / div

// --------------------------------------------------------------------------------------------------------------------}
// 𝙑𝙄𝙎𝙐𝘼𝙇𝙄𝙕𝘼𝙏𝙄𝙊𝙉
// --------------------------------------------------------------------------------------------------------------------{
if time_change
    box_size = H - L
    levels = int(box_size / step)
    bin = box_size / levels  // Prevent division by zero


    // Initialize bin volume storages
    for i = 0 to levels - 1
        array.push(bin_volumes, 0)

    // Calculate volume per bin
    for j = 0 to bar_index - index[1]
        for i = 0 to levels - 1
            lower = L + bin * i
            upper = lower + bin

            if close[j] >= lower and close[j] <= upper
                array.set(bin_volumes, i, array.get(bin_volumes, i) + volume[j])

    // Normalize volumes to create a gradient
    min_vol = array.min(bin_volumes)

    max_vol = array.max(bin_volumes)
    
    if array.size(bin_volumes) > 0 and max_vol > min_vol
        for i = 0 to levels - 1
            norm_vol = (array.get(bin_volumes, i) - min_vol) / (max_vol - min_vol)
            box_color1 = color.from_gradient(norm_vol, 0, 1, color.new(color_up, transp), color_heat)
            box_color2 = color.from_gradient(norm_vol, 0, 1, color.new(color_dn, transp), color_heat)

            box_color = max_vol == array.get(bin_volumes, i) ? color_poc : close_htf > open_htf ? box_color1 : box_color2

            lower = L + bin * i
            upper = lower + bin

            max_volume_val = max_vol == array.get(bin_volumes, i) ? str.tostring(array.get(bin_volumes, i), format.volume) : ""

            box.new(index[1], upper, bar_index, lower, bgcolor=box_color, border_color = na, text = max_volume_val)
// --------------------------------------------------------------------------------------------------------------------}

Overview

HTF Candle Volume Thermometer [ChartPrime] calculates internal volume distribution across price bins defined by ATR step sizes. Bins with higher trading activity are highlighted using dynamic color gradients to show volume concentrations within each period. Users can adjust the target timeframe, price bin resolution, and gradient color thresholds.

Details

Published by

regalouisei on GitHub

Code credit

ChartPrime, 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

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
timeframetimeframeDtimeframe
ResolutionstringMidresolution
Bull/Bearcolorcolor.limecolor_up
color_dncolorcolor.redcolor_dn
transpint80transp
Heat/Maxcolorcolor.yellowcolor_heat
color_poccolorcolor.redcolor_poc
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