OPEN-SOURCE SCRIPT
Time-Decay Liquidity Zones [BackQuant]

Time-Decay Liquidity Zones [BackQuant]
A dynamic liquidity map that turns single-bar exhaustion events into fading, color-graded zones, so you can see where trapped traders and unfinished business still matter, and when those areas have finally stopped pulling price.
What this is
This indicator detects unusually strong impulsive moves into wicks, converts them into supply or demand “zones,” then lets those zones decay over time. Each zone carries a strength score that fades bar by bar. Zones that stop attracting or rejecting price are gradually de-emphasized and eventually removed, while the most relevant areas stay bright and obvious.
Instead of static rectangles that live forever, you get a living liquidity map where:
Conceptual idea
Large wicks with strong volatility often mark areas where aggressive orders met hidden liquidity and got absorbed. Price may revisit these areas to test leftover interest or to relieve trapped positions. However, not every wick matters for long. As time passes and more bars print, the market “forgets” some areas.
Time-Decay Liquidity Zones turns that idea into a rule-based system:
How events are detected
Detection lives in the Event Detection group. The script combines range, wick size, and optional volume filters into simple rules.
Volatility filter
Wick filters
For each bar, the script splits the candle into body and wicks:
Then it tests:
Only bars with a sufficiently long wick relative to volatility qualify as candidate “liquidity events”.
Volume filter
Optionally, the script requires a volume spike:
This lets you focus only on “heavy” tests of liquidity and ignore quiet bars.
Event types
Putting it together:
How zones are constructed
Zone geometry lives in Zone Geometry.
When an event is detected, the script builds a rectangular box that anchors to the wick and extends in the appropriate direction by an ATR-based thickness.
For upper (supply-type) zones
For lower (demand-type) zones
The result is a band around the wick that scales with volatility. On high-ATR charts, zones are thicker. On calm charts, they are narrower and more precise.
Zone lifecycle, decay, and removal
All lifecycle logic is controlled by the Decay & Lifetime group.
Each zone carries:
1) Active vs broken
Each confirmed bar, the script checks:
When a zone breaks:
This lets you see where a major level was overrun, while naturally fading its influence over time.
2) Time decay
At each confirmed bar:
You are controlling how quickly the market “forgets” past events.
3) Age and score-based removal
Zones are removed when either:
When a zone is removed, its box is deleted and all associated state is freed to keep performance and visuals clean.
Unified gradient and color logic
Color control lives in Gradient & Color. The indicator uses a single continuous gradient for all zones, above and below price, so you can read strength at a glance without guessing what palette means what.
Base colors
You set:
The script then defines three internal points:
Strength normalization
Within each update:
This means a zone with strength 1.0 is currently the strongest zone on the chart. Other zones are colored relative to that.
Piecewise gradient
Color is assigned in two stages:
Strength scale legend
To make the gradient readable, the indicator draws a vertical legend on the right side of the chart:
This legend acts as a fixed reference so you can instantly map a zone’s color to its approximate strength rank.
What it plots
At a glance, the indicator produces:
There are no extra lines, labels, or clutter. The focus is the evolving structure of liquidity zones and their visual strength.
How to read the zones
Use cases
1) Intraday liquidity hunting
2) Swing trading context
3) Stop placement and invalidation
4) Identifying trapped flows
Settings overview
Event Detection
Zone Geometry
Decay & Lifetime
Gradient & Color
Tuning guidance
Fast, session-only liquidity
Slow, structural zones
Noisy, high-volatility instruments
Notes
This is a structural and contextual tool, not a complete trading system. It does not account for transaction costs, execution slippage, or your specific strategy rules. Use it to:
Time-Decay Liquidity Zones is designed to keep your chart focused on where the market has most recently “cared” about price, and to gradually forget what no longer matters. Adjust the detection, geometry, decay, and gradient to fit your product and timeframe, and let the zones show you which parts of the tape still have unfinished business.
A dynamic liquidity map that turns single-bar exhaustion events into fading, color-graded zones, so you can see where trapped traders and unfinished business still matter, and when those areas have finally stopped pulling price.
What this is
This indicator detects unusually strong impulsive moves into wicks, converts them into supply or demand “zones,” then lets those zones decay over time. Each zone carries a strength score that fades bar by bar. Zones that stop attracting or rejecting price are gradually de-emphasized and eventually removed, while the most relevant areas stay bright and obvious.
Instead of static rectangles that live forever, you get a living liquidity map where:
- Zones are born from objective criteria: volatility, wick size, and optional volume spikes.
- Zones “age” using a configurable decay factor and maximum lifetime.
- Zone color and opacity reflect current relative strength on a unified clear → green → red gradient.
- Zones freeze when broken, so you can distinguish “active reaction areas” from “historical levels that have already given way”.
Conceptual idea
Large wicks with strong volatility often mark areas where aggressive orders met hidden liquidity and got absorbed. Price may revisit these areas to test leftover interest or to relieve trapped positions. However, not every wick matters for long. As time passes and more bars print, the market “forgets” some areas.
Time-Decay Liquidity Zones turns that idea into a rule-based system:
- Find bars that likely reflect strong aggressive flows into liquidity.
- Mark a zone around the wick using ATR-based thickness.
- Assign a strength score of 1.0 at birth.
- Each bar, reduce that score by a decay factor and remove zones that fall below a threshold or live too long.
- Color all surviving zones from weak to strong using a single gradient scale and a visual legend.
How events are detected
Detection lives in the Event Detection group. The script combines range, wick size, and optional volume filters into simple rules.
Volatility filter
- ATR Length — computes a rolling ATR over your chosen window. This is the volatility baseline.
- Min range in ATRs — bar range (High–Low) must exceed this multiple of ATR for an event to be considered. This avoids tiny bars triggering zones.
Wick filters
For each bar, the script splits the candle into body and wicks:
- Upper wick = High minus the max(Open, Close).
- Lower wick = min(Open, Close) minus Low.
Then it tests:
- Upper wick condition — upper wick must be larger than Min wick size in ATRs × ATR.
- Lower wick condition — lower wick must be larger than Min wick size in ATRs × ATR.
Only bars with a sufficiently long wick relative to volatility qualify as candidate “liquidity events”.
Volume filter
Optionally, the script requires a volume spike:
- Use volume filter — if enabled, volume must exceed a rolling volume SMA by a configurable multiplier.
- Volume SMA length — period for the volume average.
- Volume spike multiplier — how many times above the SMA current volume needs to be.
This lets you focus only on “heavy” tests of liquidity and ignore quiet bars.
Event types
Putting it together:
- Upper event (potential supply / long liquidation, etc.)
Occurs when:
Upper wick is large in ATR terms.
Full bar range is large in ATR terms.
Volume is above the spike threshold (if enabled).
- Lower event (potential demand / short liquidation, etc.)
Symmetric conditions using the lower wick.
How zones are constructed
Zone geometry lives in Zone Geometry.
When an event is detected, the script builds a rectangular box that anchors to the wick and extends in the appropriate direction by an ATR-based thickness.
For upper (supply-type) zones
- Bottom of the zone = event bar high.
- Top of the zone = event bar high + Zone thickness in ATRs × ATR.
- The zone initially spans only the event bar on the x-axis, but is extended to the right as new bars appear while the zone is active.
For lower (demand-type) zones
- Top of the zone = event bar low.
- Bottom of the zone = event bar low − Zone thickness in ATRs × ATR.
- Same extension logic: box starts on the event bar and grows rightward while alive.
The result is a band around the wick that scales with volatility. On high-ATR charts, zones are thicker. On calm charts, they are narrower and more precise.
Zone lifecycle, decay, and removal
All lifecycle logic is controlled by the Decay & Lifetime group.
Each zone carries:
- Score — a floating-point “importance” measure, starting at 1.0 when created.
- Direction — +1 for upper zones, −1 for lower zones.
- Birth index — bar index at creation time.
- Active flag — whether the zone is still considered unbroken and extendable.
1) Active vs broken
Each confirmed bar, the script checks:
- For an upper zone, the zone is counted as “broken” when the close moves above the top of the zone.
- For a lower zone, the zone is counted as “broken” when the close moves below the bottom of the zone.
When a zone breaks:
- Its right edge is frozen at the previous bar (no further extension).
- The zone remains on the chart, but is no longer updated by price interaction. It still decays in score until removal.
This lets you see where a major level was overrun, while naturally fading its influence over time.
2) Time decay
At each confirmed bar:
- Score := Score × Score decay per bar.
- A decay value close to 1.0 means very slow decay and long-lived zones.
- Lower values (closer to 0.9) mean faster forgetting and more current-focused zones.
You are controlling how quickly the market “forgets” past events.
3) Age and score-based removal
Zones are removed when either:
- Age in bars exceeds Max bars a zone can live.
This is a hard lifetime cap.
- Score falls below Minimum score before removal.
This trims zones that have decayed into irrelevance even if their age is still within bounds.
When a zone is removed, its box is deleted and all associated state is freed to keep performance and visuals clean.
Unified gradient and color logic
Color control lives in Gradient & Color. The indicator uses a single continuous gradient for all zones, above and below price, so you can read strength at a glance without guessing what palette means what.
Base colors
You set:
- Mid strength color (green) — used for mid-level strength zones and as the “anchor” in the gradient.
- High strength color (red) — used for the strongest zones.
- Max opacity — the maximum visual opacity for the solid part of the gradient. Lower values here mean more solid; higher values mean more transparent.
The script then defines three internal points:
- Clear end — same as mid color, but with a high alpha (close to transparent).
- Mid end — mid color at the strongest allowed opacity.
- High end — high color at the strongest allowed opacity.
Strength normalization
Within each update:
- The script finds the maximum score among all existing zones.
- Each zone’s strength is computed as its score divided by this maximum.
- Strength is clamped into [0, 1].
This means a zone with strength 1.0 is currently the strongest zone on the chart. Other zones are colored relative to that.
Piecewise gradient
Color is assigned in two stages:
- For strength between 0.0 and 0.5: interpolate from “clear” green to solid green.
Weak zones are barely visible, mid-strength zones appear as solid green.
- For strength between 0.5 and 1.0: interpolate from solid green to solid red.
The strongest zones shift toward the red anchor, clearly separating them from everything else.
Strength scale legend
To make the gradient readable, the indicator draws a vertical legend on the right side of the chart:
- About 15 cells from top (Strong) to bottom (Weak).
- Each cell uses the same gradient function as the zones themselves.
- Top cell is labeled “Strong”; bottom cell is labeled “Weak”.
This legend acts as a fixed reference so you can instantly map a zone’s color to its approximate strength rank.
What it plots
At a glance, the indicator produces:
- Upper liquidity zones above price, built from large upper wick events.
- Lower liquidity zones below price, built from large lower wick events.
- All zones colored by relative strength using the same gradient.
- Zones that freeze when price breaks them, then fade out via decay and removal.
- A strength scale legend on the right to interpret the gradient.
There are no extra lines, labels, or clutter. The focus is the evolving structure of liquidity zones and their visual strength.
How to read the zones
- Bright red / bright green zones
These are your current “major” liquidity areas. They have high scores relative to other zones and have not yet decayed. Expect meaningful reactions, absorption attempts, or spillover moves when price interacts with them.
- Faded zones
Pale, nearly transparent zones are either old, decayed, or minor. They can still matter, but priority is lower. If these are in the middle of a long consolidation, they often become background noise.
- Broken but still visible zones
Zones whose extension has stopped have been overrun by closing price. They show where a key level gave way. You can use them as context for regime shifts or failed attempts.
- Absence of zones
A chart with few or no zones means that, under your current thresholds, there have not been strong enough liquidity events recently. Either tighten the filters or accept that recent price action has been relatively balanced.
Use cases
1) Intraday liquidity hunting
- Run the indicator on lower timeframes (e.g., 1–15 minute) with moderately fast decay.
- Use the upper zones as potential sell reaction areas, the lower zones as potential buy reaction areas.
- Combine with order flow, CVD, or footprint tools to see whether price is absorbing or rejecting at each zone.
2) Swing trading context
- Increase ATR length and range/wick multipliers to focus only on major spikes.
- Set slower decay and higher max lifetime so zones persist across multiple sessions.
- Use these zones as swing inflection areas for larger setups, for example anticipating re-tests after breakouts.
3) Stop placement and invalidation
- For longs, place invalidation beyond a decaying lower zone rather than in the middle of noise.
- For shorts, place invalidation beyond strong upper zones.
- If price closes through a strong zone and it freezes, treat that as additional evidence your prior bias may be wrong.
4) Identifying trapped flows
- Upper zones formed after violent spikes up that quickly fail can mark trapped longs.
- Lower zones formed after violent spikes down that quickly reverse can mark trapped shorts.
- Watching how price behaves on the next touch of those zones can hint at whether those participants are being rescued or squeezed.
Settings overview
Event Detection
- Use volume filter — enable or disable the volume spike requirement.
- Volume SMA length — rolling window for average volume.
- Volume spike multiplier — how aggressive the volume spike filter is.
- ATR length — period for ATR, used in all size comparisons.
- Min wick size in ATRs — minimum wick size threshold.
- Min range in ATRs — minimum bar range threshold.
Zone Geometry
- Zone thickness in ATRs — vertical size of each liquidity zone, scaled by ATR.
Decay & Lifetime
- Score decay per bar — multiplicative decay factor for each zone score per bar.
- Max bars a zone can live — hard cap on lifetime.
- Minimum score before removal — score cut-off at which zones are deleted.
Gradient & Color
- Mid strength color (green) — base color for mid-level zones and the lower half of the gradient.
- High strength color (red) — target color for the strongest zones.
- Max opacity — controls the most solid end of the gradient (0 = fully solid, 100 = fully invisible).
Tuning guidance
Fast, session-only liquidity
- Shorter ATR length (e.g., 20–50).
- Higher wick and range multipliers to focus only on extreme events.
- Decay per bar closer to 0.95–0.98 and moderate max lifetime.
- Volume filter enabled with a decent multiplier (e.g., 1.5–2.0).
Slow, structural zones
- Longer ATR length (e.g., 100+).
- Moderate wick and range thresholds.
- Decay per bar very close to 1.0 for slow fading.
- Higher max lifetime and slightly higher min score threshold so only very weak zones disappear.
Noisy, high-volatility instruments
- Increase wick and range ATR multipliers to avoid over-triggering.
- Consider enabling the volume filter with stronger settings.
- Keep decay moderate to avoid the chart getting overloaded with old zones.
Notes
This is a structural and contextual tool, not a complete trading system. It does not account for transaction costs, execution slippage, or your specific strategy rules. Use it to:
- Highlight where liquidity has recently been tested hard.
- Rank these areas by decaying strength.
- Guide your attention when layering in separate entry signals, risk management, and higher-timeframe context.
Time-Decay Liquidity Zones is designed to keep your chart focused on where the market has most recently “cared” about price, and to gradually forget what no longer matters. Adjust the detection, geometry, decay, and gradient to fit your product and timeframe, and let the zones show you which parts of the tape still have unfinished business.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Check out whop.com/signals-suite for Access to Invite Only Scripts!
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Check out whop.com/signals-suite for Access to Invite Only Scripts!
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.