//@version=5
indicator(title='Heatmap Volume [xdecow]', shorttitle='HMV [xdecow]', format=format.volume)
//------------------------------------------------------------------------------
// Inputs
length = input.int(610, title='MA Length', minval = 2, tooltip = 'Moving Average Length\n\n- Smaller values will respond more quickly and activate more frequently. (Best for short-term analysis)\n- Larger values will have a slower response, will be less sensitive to small volume variations, and will highlight large volumes. (Best for long-term analysis)\n\nFormula: How many stdev is the volume far from the Moving Average?')
slength = input.int(610, title='Standard Deviation Length', minval=2, tooltip = 'Standard Deviation lookback period.\n\nFormula: How many stdev is the volume far from the Moving Average?')
g_hmz = 'Heatmap Threshold Multipliers'
thresholdExtraHigh = input.float(4, title='Extra High Multiplier', tooltip = 'Volume Threshold Multiplier\neg: 4 = 400% or 4 x Stdev above the mean', group=g_hmz)
thresholdHigh = input(2.5, title='High Multiplier', group=g_hmz)
thresholdMedium = input.float(1, title='Medium Multiplier', group=g_hmz)
thresholdNormal = input(-0.5, title='Normal Multiplier', group=g_hmz)
//------------------------------------------------------------------------------
// Colors
// config
g_color = 'Color settings'
bcolor_enabled = input(true, 'Colored bars', group = g_color)
zmode = input.string('Backgrounds', 'Display Heatmap Zones as', options=['None', 'Lines', 'Backgrounds', 'Both'], group = g_color)
cmode = input.string('Heatmap', 'Color Mode', options=['Heatmap', 'Up/Down'], group = g_color, tooltip = '- Heatmap mode: colors based only on volume.\n- Up/Down mode: colors based on candle volume and direction.\nChange the cores below according to the selected mode.')
// heatmap colors
chm1 = #ff0000 // extra high red
chm2 = #ff7800 // high orange
chm3 = #ffcf03 // medium yellow
chm4 = #a0d6dc // normal
chm5 = #1f9cac // low
// heatmap colors
g_mhcolor = 'Heatmap colors'
chmthresholdExtraHigh = input(chm1, 'Extra High', group=g_mhcolor)
chmthresholdHigh = input(chm2, 'High', group=g_mhcolor)
chmthresholdMedium = input(chm3, 'Medium', group=g_mhcolor)
chmthresholdNormal = input(chm4, 'Normal', group=g_mhcolor)
chmthresholdLow = input(chm5, 'Low', group=g_mhcolor)
// up colors
g_up = 'Up colors'
cupthresholdExtraHigh = input(#00FF00, 'Extra High', group = g_up)
cupthresholdHigh = input(#30FF30, 'High', group = g_up)
cupthresholdMedium = input(#60FF60, 'Medium', group = g_up)
cupthresholdNormal = input(#8FFF8F, 'Normal', group = g_up)
cupthresholdLow = input(#BFFFBF, 'Low', group = g_up)
// down colors
g_down = 'Down colors'
cdnthresholdExtraHigh = input(#FF0000, 'Extra High', group = g_down)
cdnthresholdHigh = input(#FF3030, 'High', group = g_down)
cdnthresholdMedium = input(#FF6060, 'Medium', group = g_down)
cdnthresholdNormal = input(#FF8F8F, 'Normal', group = g_down)
cdnthresholdLow = input(#FFBFBF, 'Low', group = g_down)
// threshold colors
cthresholdExtraHighUp = cmode == 'Heatmap' ? chmthresholdExtraHigh : cupthresholdExtraHigh
cthresholdHighUp = cmode == 'Heatmap' ? chmthresholdHigh : cupthresholdHigh
cthresholdMediumUp = cmode == 'Heatmap' ? chmthresholdMedium : cupthresholdMedium
cthresholdNormalUp = cmode == 'Heatmap' ? chmthresholdNormal : cupthresholdNormal
cthresholdLowUp = cmode == 'Heatmap' ? chmthresholdLow : cupthresholdLow
cthresholdExtraHighDn = cmode == 'Heatmap' ? chmthresholdExtraHigh : cdnthresholdExtraHigh
cthresholdHighDn = cmode == 'Heatmap' ? chmthresholdHigh : cdnthresholdHigh
cthresholdMediumDn = cmode == 'Heatmap' ? chmthresholdMedium : cdnthresholdMedium
cthresholdNormalDn = cmode == 'Heatmap' ? chmthresholdNormal : cdnthresholdNormal
cthresholdLowDn = cmode == 'Heatmap' ? chmthresholdLow : cdnthresholdLow
//------------------------------------------------------------------------------
// Calcs
length := length > bar_index + 1 ? bar_index + 1 : length
slength := slength > bar_index + 1 ? bar_index + 1 : slength
dir = close > open
mean = ta.sma(volume, length)
std = ta.stdev(volume, slength)
// how many stdev is the volume far from the mean?
// eg: stdbar = 2.5, is 2.5 * stdev above the mean (2.5 * stdev + mean)
stdbar = (volume - mean) / std
bcolor = stdbar > thresholdExtraHigh ? dir ? cthresholdExtraHighUp : cthresholdExtraHighDn : stdbar > thresholdHigh ? dir ? cthresholdHighUp : cthresholdHighDn : stdbar > thresholdMedium ? dir ? cthresholdMediumUp : cthresholdMediumDn : stdbar > thresholdNormal ? dir ? cthresholdNormalUp : cthresholdNormalDn : dir ? cthresholdLowUp : cthresholdLowDn
// heatmap lines
zshow_lines = zmode == 'Lines' or zmode == 'Both'
zshow_backgrounds = zmode == 'Backgrounds' or zmode == 'Both'
ts1 = std * thresholdExtraHigh + mean
ts2 = std * thresholdHigh + mean
ts3 = std * thresholdMedium + mean
ts4 = std * thresholdNormal + mean
ts0 = 0
tsDelta = ts1 - ts2
tst = ts1 + tsDelta
//------------------------------------------------------------------------------
// Plots
barcolor(bcolor_enabled ? bcolor : na, editable=false)
// hidden heatmap lines to fill
pt = plot(zshow_backgrounds ? tst : na, color=na, display=display.none, editable=false)
p0 = plot(zshow_backgrounds ? ts0 : na, color=na, display=display.none, editable=false)
p1 = plot(zshow_backgrounds ? ts1 : na, color=na, display=display.none, editable=false)
p2 = plot(zshow_backgrounds ? ts2 : na, color=na, display=display.none, editable=false)
p3 = plot(zshow_backgrounds ? ts3 : na, color=na, display=display.none, editable=false)
p4 = plot(zshow_backgrounds ? ts4 : na, color=na, display=display.none, editable=false)
// heatmap fills
tpf = 85
fill(pt, p1, color.new(chm1, tpf), title='Extra High heatmap zone')
fill(p1, p2, color.new(chm2, tpf), title='High heatmap zone')
fill(p2, p3, color.new(chm3, tpf), title='Medium heatmap zone')
fill(p3, p4, color.new(chm4, tpf), title='Normal heatmap zone')
fill(p4, p0, color.new(chm5,tpf), title='Low heatmap zone')
// volume
plot(volume, color=bcolor, style=plot.style_columns, title='Volume', editable=false)
// moving average
plot(mean, color=color.new(#000000, 0), linewidth=2, title='Moving Average', style=plot.style_line, display=display.none)
// heatmap lines
tpp = 50
plot(zshow_lines ? ts1 : na, color=color.new(chm1, tpp), title='Extra High heatmap line')
plot(zshow_lines ? ts2 : na, color=color.new(chm2, tpp), title='High heatmap line')
plot(zshow_lines ? ts3 : na, color=color.new(chm3, tpp), title='Medium heatmap line')
plot(zshow_lines ? ts4 : na, color=color.new(chm4, tpp), title='Normal heatmap line')
//------------------------------------------------------------------------------
// Alerts
conditionExtraHigh = stdbar > thresholdExtraHigh
conditionHigh = stdbar <= thresholdExtraHigh and stdbar > thresholdHigh
conditionMedium = stdbar <= thresholdHigh and stdbar > thresholdMedium
conditionNormal = stdbar <= thresholdMedium and stdbar > thresholdNormal
conditionLow = stdbar <= thresholdNormal
alertcondition(conditionExtraHigh, title='Any Extra High Vol', message='Any Bar Extra High Volume Threshold')
alertcondition(conditionExtraHigh and open < close, title='Up Extra High', message='Up Bar Extra High Volume Threshold')
alertcondition(conditionExtraHigh and open > close, title='Down Extra High', message='Down Bar Extra High Volume Threshold')
alertcondition(conditionHigh, title='Any High Vol', message='Any Bar High Volume Threshold')
alertcondition(conditionHigh and open < close, title='Up High Vol', message='Up Bar High Volume Threshold')
alertcondition(conditionHigh and open > close, title='Down High Vol', message='Down Bar High Volume Threshold')
alertcondition(conditionMedium, title='Any Medium Vol', message='Any Bar Medium Volume Threshold')
alertcondition(conditionMedium and open < close, title='Up Medium Vol', message='Up Bar Medium Volume Threshold')
alertcondition(conditionMedium and open > close, title='Down Medium Vol', message='Down Bar Medium Volume Threshold')
Overview
Heatmap Volume [xdecow] classifies volume into five distinct intensity tiers—Extra High, High, Medium, Normal, and Low—based on configurable standard deviation multipliers. Users can choose between a pure heatmap coloring mode or a directional up/down mode that also accounts for candle direction. Additionally, the indicator can highlight threshold zones using lines, background fills, or both. It serves purely as an analytical visualization tool without automated trade signals.
Standard deviation volume tier classification
Configurable threshold multipliers
Heatmap and directional up/down color modes
Optional heatmap zone background and line displays
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
MA Length
int
610
length
Standard Deviation Length
int
610
slength
Extra High Multiplier
float
4
thresholdExtraHigh
High Multiplier
float
2.5
thresholdHigh
Medium Multiplier
float
1
thresholdMedium
Normal Multiplier
float
-0.5
thresholdNormal
Colored bars
bool
true
bcolor_enabled
Display Heatmap Zones as
string
Backgrounds
zmode
Color Mode
string
Heatmap
cmode
Extra High
input
chm1
chmthresholdExtraHigh
High
input
chm2
chmthresholdHigh
Medium
input
chm3
chmthresholdMedium
Show all 24 settings
Setting
Type
Default
Variable
Normal
input
chm4
chmthresholdNormal
Low
input
chm5
chmthresholdLow
Extra High
color
#00FF00
cupthresholdExtraHigh
High
color
#30FF30
cupthresholdHigh
Medium
color
#60FF60
cupthresholdMedium
Normal
color
#8FFF8F
cupthresholdNormal
Low
color
#BFFFBF
cupthresholdLow
Extra High
color
#FF0000
cdnthresholdExtraHigh
High
color
#FF3030
cdnthresholdHigh
Medium
color
#FF6060
cdnthresholdMedium
Normal
color
#FF8F8F
cdnthresholdNormal
Low
color
#FFBFBF
cdnthresholdLow
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.
Calculates the standard Money Flow Index (MFI) oscillator alongside an exponential moving average signal line in a separate pane. The script visually highlights trend conditions through dynamic ribbon filling, optional difference histogram bars, and overbought
This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional
Range Volume Change compares volume inside a chosen session window with the same window on the previous day and plots that change as a percentage. It accumulates volume during the window and, when enabled, volume outside it, drawing growing columns in a separa
Calculates On-Balance Volume (OBV) alongside two Exponential Moving Averages (EMAs) applied directly to the cumulative OBV line. The indicator tracks volume flow relative to price movement and smooths it using short-term and longer-term EMAs to highlight volum
This indicator builds a footprint of estimated buy and sell volume across price rows and plots it in a separate pane. It fills rows from bar low to high, stores volume per row, and draws buy and sell volume boxes, volume-profile boxes, row labels, and cumulati
This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete