OPEN-SOURCE SCRIPT
Relative Strength Heatmap [BackQuant]

Relative Strength Heatmap [BackQuant]
A multi-horizon RSI matrix that compresses 20 different lookbacks into a single panel, turning raw momentum into a visual “pressure gauge” for overbought and oversold clustering, trend exhaustion, and breadth of participation across time horizons.
What this is
This indicator builds a strip-style heatmap of 20 RSIs, each with a different length, and stacks them vertically as colored tiles in a single pane. Every tile is colored by its RSI value using your chosen palette, so you can see at a glance:
On top of the tiles, the script plots two simple breadth lines:
This turns a single symbol’s RSI ladder into a compact “market pressure gauge” that shows not only whether RSI is overbought or oversold, but how many different horizons agree at the same time.
Core idea
A single RSI looks at one length and one timescale. Markets, however, are driven by flows that operate on multiple horizons at once. By computing RSI over a ladder of lengths, you approximate a “term structure” of strength:
When many lengths agree, for example 10 or more RSIs all above 70, it suggests broad participation and strong directional pressure. When only a few fast lengths stretch to extremes while longer ones stay neutral, the move is more fragile and more likely to mean-revert.
This script makes that structure visible as a heatmap instead of forcing you to run many separate RSI panes.
How it works
1) Generating RSI lengths
You control three parameters in the calculation settings:
Each of the 20 RSIs uses:
RSI length = round((base_length + step × index) × multiplier), where the index goes from 0 to 19.
That means:
You can keep the ladder dense (small step and multiplier) or stretch it across much longer horizons.
2) Heatmap layout and grouping
Each RSI is plotted as an “area” strip at a fixed vertical level using histbase to stack them:
Each group has a toggle:
The actual numeric RSI values are not plotted as lines. Instead, each strip is drawn as a horizontal band whose fill color represents the current RSI regime.
3) Palette-based coloring
Each tile’s color is driven by the RSI value and your chosen palette. The script includes several palettes:
Internally, RSI values are bucketed into ranges (for example, below 10, 10–20, …, 90–100). Each bucket maps to a unique colour for that palette. In all schemes, low RSI values are mapped to the “cold” or darker side and high RSI values to the “hot” or brighter side.
The result is a true momentum heatmap:
4) Bull and bear breadth counts
All 20 RSI values are collected into an array each bar. Two counters are then calculated:
These are plotted as:
If you enable the “Show Bull and Bear Count” option, you get an immediate reading of how many of the 20 horizons are stretched at any moment.
5) Cluster alerts and background tagging
Two alert conditions monitor “strong cluster” regimes:
When one of these conditions is true, the indicator can tint the background of the chart using a soft version of the current palette. This visually marks stretches where momentum is extreme across many lengths at once, not just on a single RSI.
What it plots
In one oscillator window, the indicator provides:
How it measures breadth and pressure
Single-symbol breadth
Breadth is usually defined across a basket of symbols, such as how many stocks advance versus decline. This indicator uses the same concept across time horizons for a single symbol. The question becomes:
“How many different RSI lengths are stretched in the same direction at once?”
Examples:
This is breadth of momentum within one market.
Market pressure gauge
The combination of heatmap tiles and breadth lines acts as a pressure gauge:
You can treat the strong-cluster alerts as “extreme pressure” signals. When they fire, the market is heavily skewed in one direction across many horizons.
How to read the heatmap
Horizontal patterns (through time)
Look along the time axis and watch how the colors evolve:
Vertical structure (across lengths at one bar)
Focus on a single bar and read the column of tiles from top to bottom:
Bull and bear breadth lines
Use the two lines as simple, numeric breadth indicators:
Cluster zones
When either count crosses the strong threshold (for example 10 out of 20 RSIs in extreme territory):
Trading applications
Trend confirmation
Use the heatmap and breadth lines as a trend filter:
Mean-reversion timing
Treat cluster extremes as exhaustion zones:
Regime detection and risk toggling
Use the overall shape of the ladder over time:
Multi-horizon synchronization
You can think of each RSI length as a proxy for a different “speed” of the same market:
Spotting hidden shifts
Sometimes price appears flat or drifting, but the heatmap quietly cools or warms:
Settings overview
Calculation Settings
Plotting and Coloring Settings
Alerts
Tuning guidance
Fast, tactical configurations
Swing and position configurations
Macro or higher timeframe configurations
Notes
This indicator is a contextual tool, not a standalone trading system. It does not model execution, spreads, slippage or fundamental drivers. Use it to:
The Relative Strength Heatmap is designed to answer a simple but powerful question:
“How many versions of RSI agree with what I am seeing on the chart?”
By compressing those answers into a single panel with clear colour coding and breadth lines, it becomes a practical, visual gauge of momentum breadth and market pressure that you can overlay on any trading framework.
A multi-horizon RSI matrix that compresses 20 different lookbacks into a single panel, turning raw momentum into a visual “pressure gauge” for overbought and oversold clustering, trend exhaustion, and breadth of participation across time horizons.
What this is
This indicator builds a strip-style heatmap of 20 RSIs, each with a different length, and stacks them vertically as colored tiles in a single pane. Every tile is colored by its RSI value using your chosen palette, so you can see at a glance:
- How many “fast” versus “slow” RSIs are overbought or oversold.
- Whether momentum is concentrated in the short lookbacks or spread across the whole curve.
- When momentum extremes cluster, signalling strong market pressure or exhaustion.
On top of the tiles, the script plots two simple breadth lines:
- A white line that counts how many RSIs are above 70 (overbought cluster).
- A black line that counts how many RSIs are below 30 (oversold cluster).
This turns a single symbol’s RSI ladder into a compact “market pressure gauge” that shows not only whether RSI is overbought or oversold, but how many different horizons agree at the same time.
Core idea
A single RSI looks at one length and one timescale. Markets, however, are driven by flows that operate on multiple horizons at once. By computing RSI over a ladder of lengths, you approximate a “term structure” of strength:
- Short lengths react to immediate swings and very recent impulses.
- Medium lengths reflect swing behaviour and local trends.
- Long lengths reflect structural bias and higher timeframe regime.
When many lengths agree, for example 10 or more RSIs all above 70, it suggests broad participation and strong directional pressure. When only a few fast lengths stretch to extremes while longer ones stay neutral, the move is more fragile and more likely to mean-revert.
This script makes that structure visible as a heatmap instead of forcing you to run many separate RSI panes.
How it works
1) Generating RSI lengths
You control three parameters in the calculation settings:
- RS Period – the base RSI length used for the shortest strip.
- RSI Step – the amount added to each successive RSI length.
- RSI Multiplier – a global scaling factor applied after the step.
Each of the 20 RSIs uses:
RSI length = round((base_length + step × index) × multiplier), where the index goes from 0 to 19.
That means:
- RSI 1 uses (len + step × 0) × mult.
- RSI 2 uses (len + step × 1) × mult.
- …
- RSI 20 uses (len + step × 19) × mult.
You can keep the ladder dense (small step and multiplier) or stretch it across much longer horizons.
2) Heatmap layout and grouping
Each RSI is plotted as an “area” strip at a fixed vertical level using histbase to stack them:
- RSI 1–5 form Group 1.
- RSI 6–10 form Group 2.
- RSI 11–15 form Group 3.
- RSI 16–20 form Group 4.
Each group has a toggle:
- Show only Group 1 and 2 if you care mainly about fast and medium horizons.
- Show all groups for a full spectrum from very short to very long.
- Hide any group that feels redundant for your workflow.
The actual numeric RSI values are not plotted as lines. Instead, each strip is drawn as a horizontal band whose fill color represents the current RSI regime.
3) Palette-based coloring
Each tile’s color is driven by the RSI value and your chosen palette. The script includes several palettes:
- Viridis – smooth green to yellow, good for subtle reading.
- Jet – strong blue to red sequence with high contrast.
- Plasma – purple through orange to yellow.
- Custom Heat – cool blues to neutral grey to hot reds.
- Gray – grayscale from white to black for minimalistic layouts.
- Cividis, Inferno, Magma, Turbo, Rainbow – additional scientific and rainbow-style maps.
Internally, RSI values are bucketed into ranges (for example, below 10, 10–20, …, 90–100). Each bucket maps to a unique colour for that palette. In all schemes, low RSI values are mapped to the “cold” or darker side and high RSI values to the “hot” or brighter side.
The result is a true momentum heatmap:
- Cold or dark tiles show low RSI and oversold or compressed conditions.
- Mid tones show neutral or mid-range RSI.
- Warm or bright tiles show high RSI and overbought or stretched conditions.
4) Bull and bear breadth counts
All 20 RSI values are collected into an array each bar. Two counters are then calculated:
- Bull count – how many RSIs are above 70.
- Bear count – how many RSIs are below 30.
These are plotted as:
- A white line (“RSI > 70 Count”) for the overbought cluster.
- A black line (“RSI < 30 Count”) for the oversold cluster.
If you enable the “Show Bull and Bear Count” option, you get an immediate reading of how many of the 20 horizons are stretched at any moment.
5) Cluster alerts and background tagging
Two alert conditions monitor “strong cluster” regimes:
- RSI Heatmap Strong Bull – triggers when at least 10 RSIs are above 70.
- RSI Heatmap Strong Bear – triggers when at least 10 RSIs are below 30.
When one of these conditions is true, the indicator can tint the background of the chart using a soft version of the current palette. This visually marks stretches where momentum is extreme across many lengths at once, not just on a single RSI.
What it plots
In one oscillator window, the indicator provides:
- Up to 20 horizontal RSI strips, each representing a different RSI length.
- Color-coded tiles reflecting the current RSI value for each length.
- Group toggles to show or hide each block of five RSIs.
- An optional white line that counts how many RSIs are above 70.
- An optional black line that counts how many RSIs are below 30.
- Optional background highlights when the number of overbought or oversold RSIs passes the strong-cluster threshold.
How it measures breadth and pressure
Single-symbol breadth
Breadth is usually defined across a basket of symbols, such as how many stocks advance versus decline. This indicator uses the same concept across time horizons for a single symbol. The question becomes:
“How many different RSI lengths are stretched in the same direction at once?”
Examples:
- If only 2 or 3 of the shortest RSIs are above 70, bull count stays low. The move is fast and local, but not yet broadly supported.
- If 12 or more RSIs across short, medium and long lengths are above 70, the bull count spikes. The move has broad momentum and strong upside pressure.
- If 10 or more RSIs are below 30, bear count spikes and you are in a broad oversold regime.
This is breadth of momentum within one market.
Market pressure gauge
The combination of heatmap tiles and breadth lines acts as a pressure gauge:
- High bull count with warm colors across most strips indicates strong upside pressure and crowded long positioning.
- High bear count with cold colors across most strips indicates strong downside pressure and capitulation or forced selling.
- Low counts with a mixed heatmap indicate neutral pressure, fragmented flows, or range-bound conditions.
You can treat the strong-cluster alerts as “extreme pressure” signals. When they fire, the market is heavily skewed in one direction across many horizons.
How to read the heatmap
Horizontal patterns (through time)
Look along the time axis and watch how the colors evolve:
- Persistent hot tiles across many strips show sustained bullish pressure and trend strength.
- Persistent cold tiles across many strips show sustained bearish pressure and weak demand.
- Frequent flipping between hot and cold colours indicates a choppy or mean-reverting environment.
Vertical structure (across lengths at one bar)
Focus on a single bar and read the column of tiles from top to bottom:
- Short RSIs hot, long RSIs neutral or cool: early trend or short-term fomo. Price has moved fast, longer horizons have not caught up.
- Short and long RSIs all hot: mature, entrenched uptrend. Broad participation, high pressure, greater risk of blow-off or late-entry vulnerability.
- Short RSIs cold but long RSIs mid to high: pullback in a higher timeframe uptrend. Dip-buy and continuation setups are often found here.
- Short RSIs high but long RSIs low: countertrend rallies within a broader downtrend. Good hunting ground for fades and short entries after a bounce.
Bull and bear breadth lines
Use the two lines as simple, numeric breadth indicators:
- A rising white line shows more RSIs pushing above 70, so bullish pressure is expanding in breadth.
- A rising black line shows more RSIs pushing below 30, so bearish pressure is expanding in breadth.
- When both lines are low and flat, few horizons are extreme and the market is in mid-range territory.
Cluster zones
When either count crosses the strong threshold (for example 10 out of 20 RSIs in extreme territory):
- A strong bull cluster marks a broadly overbought regime. Trend followers may see this as confirmation. Mean-reversion traders may see it as a late-stage or blow-off context.
- A strong bear cluster marks a broadly oversold regime. Downtrend traders see strong pressure, but the risk of sharp short-covering bounces also increases.
Trading applications
Trend confirmation
Use the heatmap and breadth lines as a trend filter:
- Prefer long setups when the heatmap shows mostly mid to high RSIs and the bull count is rising.
- Avoid fresh shorts when there is a strong bull cluster, unless you are specifically trading exhaustion.
- Prefer short setups when the heatmap is mostly low RSIs and the bear count is rising.
- Avoid aggressive longs when a strong bear cluster is active, unless you are trading reflexive bounces.
Mean-reversion timing
Treat cluster extremes as exhaustion zones:
- Look for reversal patterns, failed breakouts, or order flow shifts when bull count is very high and price starts to stall or diverge.
- Look for reflexive bounce potential when bear count is very high and price stops making new lows or shows absorption at the lows.
- Use the palette and counts together: hot tiles plus a peaking white line can mark blow-off conditions, cold tiles plus a peaking black line can mark capitulation.
Regime detection and risk toggling
Use the overall shape of the ladder over time:
- If upper strips stay warm and lower strips stay neutral or warm for extended periods, the market is in an uptrend regime. You can justify higher risk for long-biased strategies.
- If upper strips stay cold and lower strips stay neutral or cold, the market is in a downtrend regime. You can justify higher risk for short-biased strategies or defensive positioning.
- If colours and counts flip frequently, you are likely in a range or choppy regime. Consider reducing size or using more tactical, short-term strategies.
Multi-horizon synchronization
You can think of each RSI length as a proxy for a different “speed” of the same market:
- When only fast RSIs are stretched, the move is local and less robust.
- When fast, medium and slow RSIs align, the move has multi-horizon confirmation.
- You can require a minimum bull or bear count before allowing your main strategy to engage.
Spotting hidden shifts
Sometimes price appears flat or drifting, but the heatmap quietly cools or warms:
- If price is sideways while many hot tiles fade toward neutral, momentum is decaying under the surface and trend risk is increasing.
- If price is sideways while many cold tiles climb back toward neutral, selling pressure is decaying and the tape is repairing itself.
Settings overview
Calculation Settings
- RS Period – base RSI length for the shortest strip.
- RSI Step – the increment added to each successive RSI length.
- RSI Multiplier – scales all generated RSI lengths.
- Calculation Source – the input series, such as close, hlc3 or others.
Plotting and Coloring Settings
- Heatmap Color Palette – choose between Viridis, Jet, Plasma, Custom Heat, Gray, Cividis, Inferno, Magma, Turbo or Rainbow.
- Show Group 1 – toggles RSI 1–5.
- Show Group 2 – toggles RSI 6–10.
- Show Group 3 – toggles RSI 11–15.
- Show Group 4 – toggles RSI 16–20.
- Show Bull and Bear Count – enables or disables the two breadth lines.
Alerts
- RSI Heatmap Strong Bull – fires when the number of RSIs above 70 reaches or exceeds the configured threshold (default 10).
- RSI Heatmap Strong Bear – fires when the number of RSIs below 30 reaches or exceeds the configured threshold (default 10).
Tuning guidance
Fast, tactical configurations
- Use a small base RS Period, for example 2 to 5.
- Use a small RSI Step, for tight clustering around the fast horizon.
- Keep the multiplier near 1.0 to avoid extreme long lengths.
- Focus on Group 1 and Group 2 for intraday and short-term trading.
Swing and position configurations
- Use a mid-range RS Period, for example 7 to 14.
- Use a moderate RSI Step to fan out into slower horizons.
- Optionally use a multiplier slightly above 1.0.
- Keep all four groups enabled for a full view from fast to slow.
Macro or higher timeframe configurations
- Use a larger base RS Period.
- Use a larger RSI Step so the top of the ladder reaches very slow lengths.
- Focus on Group 3 and Group 4 to see structural momentum.
- Treat clusters as regime markers rather than frequent trading signals.
Notes
This indicator is a contextual tool, not a standalone trading system. It does not model execution, spreads, slippage or fundamental drivers. Use it to:
- Understand whether momentum is narrow or broad across horizons.
- Confirm or filter existing signals from your primary strategy.
- Identify environments where the market is crowded into one side.
- Distinguish between isolated spikes and truly broad pressure moves.
The Relative Strength Heatmap is designed to answer a simple but powerful question:
“How many versions of RSI agree with what I am seeing on the chart?”
By compressing those answers into a single panel with clear colour coding and breadth lines, it becomes a practical, visual gauge of momentum breadth and market pressure that you can overlay on any trading framework.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Check out whop.com/signals-suite for Access to Invite Only Scripts!
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
Check out whop.com/signals-suite for Access to Invite Only Scripts!
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.