Volatility Heatmap Bands [PickMyTrade]━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT IT DOES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Volatility Heatmap Bands fits a log-normal distribution to recent price returns and draws a statistically calibrated price envelope — then colours every bar by where it sits inside that envelope.
Simple version: the red band at the top is the "overbought wall." The cyan band at the bottom is the "oversold wall." When bars turn red, price is statistically stretched toward the top. When bars turn cyan, price is statistically stretched toward the bottom. The colour tells you whether a move is normal or extreme — without reading a single number.
Three layers power every calculation:
▸ Log-Normal Drift (μ) — rolling mean of log-returns, representing the direction price is diffusing
▸ Volatility (σ) — rolling standard deviation of log-returns, updated every bar
▸ Itô Correction (−½σ²) — converts the arithmetic mean to a geometric mean, required for continuous-time price models. Without this, the envelope is systematically biased upward
The result is a probability corridor that widens in volatile markets and tightens in calm ones — automatically, with no manual adjustment.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
THE HEATMAP EXPLAINED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Each bar is coloured by a single value: the normalised position of close within the 10th–90th percentile envelope.
position = (close − 10th band) / (90th band − 10th band)
0.0 → close is at or below the 10th band → deep cyan
0.5 → close is at the midpoint → neutral
1.0 → close is at or above the 90th band → deep red
This is not a momentum oscillator and not RSI. It is a spatial measure of where price sits inside its own forward-projected distribution. A deep-red bar means the current close is in the top decile of the statistically projected range — not that it is rising fast, but that it has reached a zone that is historically reached only 10% of the time.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SIGNALS — ▲ LONG / ▼ SHORT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
A breakout signal fires when price exits the N-bar channel:
▲ Long — close breaks above the highest close of the last N bars
▼ Short — close breaks below the lowest close of the last N bars
An optional trend filter (slow EMA gate) removes counter-trend signals:
• Longs only when close is above the trend EMA
• Shorts only when close is below the trend EMA
Signals appear as small triangles on the chart. They are not trade recommendations — they mark a structural breakout that coincides with a momentum expansion, for the trader to act on within their own framework.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
VOLATILITY REGIME DETECTION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
σ is compared to its own rolling distribution via a percentile rank:
≥ 75th percentile of σ → High Vol regime (subtle orange background)
25th – 75th → Normal regime (no tint)
< 25th percentile of σ → Low Vol regime (subtle blue background)
Why it matters: the same breakout signal in a High Vol regime carries a wider envelope and therefore a different risk profile than the same breakout in Low Vol. The background tint makes the regime visible at a glance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WHAT MAKES IT DIFFERENT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Most volatility bands (Bollinger, Keltner, Donchian) are constructed from past price movement around a moving average. They describe where price has been.
VHB projects forward. The envelope is calculated at the current close and extended H bars into the future using the fitted distribution. The bands show where price is statistically likely to be in H bars — not where it has been.
Consequence: in a trending market the bands tilt with the drift. In a mean-reverting market the bands remain flat. The geometry of the envelope changes with market character, not with arbitrary multiplier choices.
The Itô correction is not a cosmetic detail. In continuous-time finance, the expected log-price grows at μ − ½σ², not μ. Omitting the correction causes the upper band to overstate likely price levels by an amount that grows with σ² — small in calm markets, significant during volatility expansion. VHB applies the correction on every bar.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE IT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Apply to any liquid instrument — futures (MNQ, NQ, ES, CL, GC), forex pairs, crypto
2. Choose your timeframe:
• 1m / 5m — scalping, intraday momentum
• 15m / 1H — intraday swing
• 4H / Daily — positional
3. Read the heatmap first:
• Cyan bars near the lower band → price is statistically cheap relative to its own distribution
• Red bars near the upper band → price is statistically expensive
4. Wait for a signal ▲ / ▼ to confirm directional intent
5. Use the info panel (bottom-right) to monitor CDF Score, σ/bar, regime, and band levels in real time
6. Set alerts via the Alerts tab for Long Signal, Short Signal, or Regime changes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SETTINGS REFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
| Input | Default | Purpose |
|---|---|---|
| Fit Lookback | 100 | Bars used to estimate μ and σ |
| Holding Horizon | 10 | Bars forward the distribution is projected |
| Breakout Channel | 20 | N-bar high/low for signal detection |
| Trend Filter | ON | EMA gate — removes counter-trend signals |
| Trend EMA Length | 200 | Slow EMA period for directional gate |
| Show Outer Bands | ON | 10th and 90th percentile lines |
| Show Median | ON | 50th percentile — Itô-corrected drift line |
| Show Inner Bands | OFF | 25th and 75th percentile lines |
| Fill Band | ON | Dark fill between 10th and 90th |
| Heatmap Bar Colour | ON | Cyan–red gradient by envelope position |
| Highlight Regime | ON | Subtle background tint by volatility regime |
| Show Info Panel | ON | Live σ, CDF score, drift, bands, signal |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Requires at least Fit Lookback bars of history before the first band appears
• Works on any asset class; continuous instruments (futures, forex) show the cleanest log-return distribution
• The indicator does not repaint — all band values are calculated from confirmed closed bars
• Signals use close for channel calculation — no lookahead bias
• This tool is for research and educational purposes only. It is not financial advice.
Индикатор Pine Script®






















