Volume Climax Detector (Z-Score)
Volume climax detection measures how far current volume deviates from its recent average, expressed as standard deviations from the mean. This z-score approach helps traders identify when volume reaches unusual levels that may accompany trend reversals, breakout attempts, or capitulation moves. Swing traders and intraday operators use volume climax signals to confirm support and resistance breaks and to spot exhaustion moves where heavy selling or buying has depleted short-term momentum.
//@version=6
indicator("Volume Climax Detector (Z-Score)", shorty_title="Vol Climax", overlay=false)
// Inputs
lookback = input.int(20, title="Lookback Period", minval=2, maxval=500)
upperThreshold = input.float(2.0, title="Upper Threshold (σ)", minval=0.1, step=0.1)
lowerThreshold = input.float(-2.0, title="Lower Threshold (σ)", minval=-10, step=0.1)
showHistogram = input.bool(true, title="Show Histogram")
// Volume calculations
volMean = ta.sma(volume, lookback)
volStdDev = ta.stdev(volume, lookback)
// Z-score: (current - mean) / stddev
volZScore = volStdDev != 0 ? (volume - volMean) / volStdDev : 0
// Plotting
plot(volZScore, title="Volume Z-Score", color=color.new(color.blue, 0), linewidth=2)
hline(0, title="Zero Line", color=color.gray, linestyle=hline.dashed)
hline(upperThreshold, title="Upper Threshold", color=color.new(color.red, 50), linestyle=hline.dashed)
hline(lowerThreshold, title="Lower Threshold", color=color.new(color.green, 50), linestyle=hline.dashed)
// Histogram coloring
histColor = volZScore > upperThreshold ? color.new(color.red, 40) :
volZScore < lowerThreshold ? color.new(color.green, 40) : color.new(color.gray, 60)
if showHistogram
barcolor(histColor)
// Background shading for threshold crossings
bgcolor(volZScore > upperThreshold ? color.new(color.red, 90) :
volZScore < lowerThreshold ? color.new(color.green, 90) : na, title="Climax Zone")
How the code works
The indicator first computes a 20-period (user-adjustable) simple moving average of volume to establish the baseline. It then calculates the standard deviation of volume over the same window, which quantifies how much volume typically varies in that timeframe. The z-score is computed as (current volume, mean) / standard deviation, normalizing each bar's volume relative to recent history. A z-score of 2.0 means volume is two standard deviations above average; a z-score of -2.0 means it is two standard deviations below.
The script plots the z-score as a line, adds reference lines at zero (neutral), upper threshold (default +2.0 σ), and lower threshold (default -2.0 σ). When enabled, the histogram background colors bars red when the z-score exceeds the upper threshold (volume climax on buying) and green when it falls below the lower threshold (climax on selling). Background shading highlights these extreme zones directly on the chart for quick visual scanning.
Reading it on a chart
A z-score above 2.0 signals that volume is at least twice as volatile as the 20-bar average, often coinciding with large institutional moves, gap fills, or capitulation. Traders watch for upper-threshold breaches on days with strong directional conviction to confirm breakouts from resistance or rallies into resistance. Conversely, a z-score below -2.0 is rare and signals volume has collapsed to half the expected range, sometimes preceding volatility expansion or trap moves. Below-threshold events on down days may indicate institutional liquidation where volume is insufficient to absorb selling pressure, setting up a reversal.
Practitioner convention treats z-scores between -1 and +1 as normal; +1 to +2 as elevated but not extreme; and outside ±2 as climactic. Combining the z-score with price action at support or resistance increases signal reliability. For example, a volume z-score above +2 at resistance, without a break above that level, may warn of rejection; the same z-score on a close above resistance suggests a valid breakout.
Limitations
Z-score assumes volume follows a normal distribution, which is often violated in real markets where volume spikes are fat-tailed (more extreme events than the normal distribution predicts) and may cluster during market opens, economic releases, or news events. The lookback period directly affects sensitivity: a 10-period lookback will flag more climaxes as extreme; a 50-period lookback will only flag the most unusual events. There is no universal threshold; a z-score of 2.5 on an illiquid stock or thin futures contract may be routine, while 1.5 on a highly liquid name may be noteworthy. The indicator does not distinguish between climaxes on rallies versus declines; both register the same z-score magnitude, yet carry different implications for trend continuation. Volume seasonality, elevated volume around market opens, options expirations, or macro data, is not accounted for. Most critically, extreme volume is necessary but not sufficient for reversal; many volume climaxes occur within existing trends and do not mark exhaustion. Confirmation from price structure, support/resistance, or moving-average proximity is required to act on the signal.
Key definitions
Z-score: The number of standard deviations a data point lies from the mean; calculated as (value − mean) ÷ standard deviation.
Standard deviation: A measure of dispersion that quantifies typical variation in a dataset; higher values indicate wider spread.
Volume mean: The average volume over a specified lookback period, serving as the baseline expectation for normal trading activity.
Climax volume: An extreme surge or collapse in volume relative to recent ranges, often associated with reversals, breakout attempts, or capitulation.
Lookback period: The number of bars used to calculate mean and standard deviation; shorter periods increase sensitivity to recent changes, longer periods smooth out noise.
Normal distribution: A statistical bell-curve model assuming most values cluster near the mean with symmetrical tails; markets often exhibit fatter tails and skew, violating this assumption.
References
- CME Group, "Futures Volume and Open Interest", CME Education. Https://www.cmegroup.com/education.html (2020)
- Wilder, J.W., "New Concepts in Technical Trading Systems", Wilder Inc. (1978)
- Investopedia, "Volume: Definition, Importance and How to Use It", Investopedia. Https://www.investopedia.com/terms/v/volume.asp (2024)
- CFTC, "Guide to Commodity Futures Trading", U.S. Commodity Futures Trading Commission. Https://www.cftc.gov (2023)
- Bulkowski, T.N., "Encyclopedia of Chart Patterns", 2nd Edition (2005), practitioner reference on volume climax patterns in price reversals.
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-09-20. Educational research on historical data, not financial advice.
Keep reading
RSI Divergence Flagger with Strict Pivot Rules
Free open-source Pine Script indicator: RSI divergence flagger with strict pivot rules. Full code and a plain-English walkthrough.
Swing Structure: BOS and CHoCH Labels
Free open-source Pine Script indicator: swing high/low structure marker (BOS and CHoCH labels). Full code and a plain-English walkthrough.
ATR-Based Volatility Bands
Free open-source Pine Script indicator: ATR-based volatility bands. Full code and a plain-English walkthrough.