Relative Volume Heatmap
- Indicators
- Version: 1.0
- Activations: 5
# Relative Volume Heatmap - Volume relative to its own hour
*Category: Volume | Difficulty: beginner | Window: separate window below the chart | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M5, M15, M30, H1*
## Short description
> Compares the bar volume with the historical average of the same hour band and colours it on four levels. It spots genuine participation anomalies, not clock effects.
### Overview
Absolute volume is nearly useless on intraday timeframes, because it mostly depends on the hour: at three in the morning it will always be low and at the US open always high, regardless of what is actually happening. Looking at raw volume on an M15 chart therefore means mostly looking at a clock. This indicator solves the problem by comparing the bar volume with the historical average volume of the same hour band and showing their ratio as a percentage. A value of 250 means volume two and a half times above normal for that hour: a genuine anomaly. The bars are coloured on four intensity levels, forming a heatmap that makes it immediate to spot where participation was truly exceptional relative to its own hourly norm.
### How the calculation works
1. Each bar volume is stored in a working buffer.
2. For each bar the previous InpLookback bars are scanned, selecting only those falling in the same hour of the day.
3. The average of their volumes is the reference for that hour band.
4. If fewer than InpMinSamples observations are available the comparison is not made and the bar stays neutral.
5. The percentage ratio is clamped at six hundred, because beyond that single spikes would make the scale unreadable.
6. Three increasing thresholds define the four heatmap levels, automatically reordered if set inconsistently.
### How to use it
- Red bars indicate exceptional participation for that hour: something is happening that deserves immediate attention.
- The lightest colour indicates ordinary volume for that hour, even though in absolute terms it might be high or low.
- A red bar in a normally quiet hour band is far more significant than the same bar at the US open.
- Use it to validate breakouts: a break accompanied by high relative volume has a far greater chance of continuing.
- Raise InpLookback for a more stable reference, knowing more bars will be needed before the first useful value.
### Who it is for and on which timeframes
It is the simplest of the category and requires no background: comparing current volume with the usual volume for this hour is an immediate concept. Precisely for that reason it works well as a first filter even for less experienced traders. It is designed for timeframes from M5 to H1: on higher ones a single bar spans several hour bands and the comparison loses meaning. It requires intraday history of at least a few weeks, because each band must gather enough observations.
### Practical example of reading a signal
On EURUSD M15 it is six in the morning server time, a normally quiet band. The absolute bar volume is modest and on an ordinary volume histogram it would go entirely unnoticed. The heatmap instead reads 340 and colours the bar red: for that hour that volume is more than triple the normal. Something happened, and indeed price breaks the overnight range on the next bar. A trader watching only absolute volume would have seen nothing; one watching volume relative to the hour band received the signal one bar earlier.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpLookback` | 600 | History bars examined to build the hourly reference. Internally capped at 3000 to contain the computational cost. |
| `InpMinSamples` | 5 | Minimum observations required per hour band. Below this threshold the bar stays neutral instead of producing an unreliable comparison. |
| `InpLevel1` | 150.0 | First heatmap threshold, beyond which activity is above normal. |
| `InpLevel2` | 220.0 | Second threshold, for very high activity. |
| `InpLevel3` | 320.0 | Third threshold, for exceptional activity. The three thresholds are automatically reordered if set inconsistently. |
| `InpUseRealVolume` | false | With true, real volume is used when available; with false, or in its absence, tick volume. |
## Advantages / strengths
- It removes the clock effect that makes absolute volume nearly unusable on intraday timeframes.
- The four level map makes anomalies immediately visible even on a crowded chart.
- An elementary concept, usable with no learning curve.
- It refuses to produce a comparison when the available observations are insufficient.
## Limitations and warnings
- Scanning back hundreds of bars on every bar makes the first pass noticeably slow.
- The reference depends on the broker server time: changing broker or at the daylight saving switch the profile shifts.
- It aggregates all weekdays: Monday and Friday have different volume profiles that are averaged together here.
- It requires deep intraday history and does not work well on instruments with fragmented trading hours.
**No repaint:** values printed on a closed bar are never modified afterwards.
**Disclaimer.** This product is a technical analysis tool, not an automated trading system, and it offers no profit guarantee whatsoever. Financial markets carry the risk of total loss of the invested capital. Past performance is not indicative of future results. Every signal must be confirmed with your own analysis, a money management plan and prior testing on a demo account. The author is not responsible for trading decisions taken on the basis of this indicator.
## Suggested tags / keywords for MQL5
`volume`, `relative volume`, `heatmap`, `intraday`, `seasonality`, `anomaly`, `no repaint`, `breakout filter`
