DDDDD: Liquidity Trap ReversalDDDDD: Liquidity Trap Reversal
This indicator is designed to detect potential reversal zones that form after an apparent liquidity sweep at local extremes.
The core idea is not to chase breakout candles blindly, but to identify situations where price extends into prior highs or lows, attracts participation, and then begins to show signs of exhaustion.
Instead of treating every breakout as continuation, this script looks for a specific reversal environment built from trend context, range expansion, abnormal volume, and momentum slowdown.
Core concept
Markets often move into obvious swing highs or swing lows to trigger stops, breakout entries, or forced positioning.
In some cases, that expansion is not the beginning of a clean trend leg, but the late phase of a move where liquidity is being taken before momentum weakens.
This script attempts to highlight those areas by combining:
a higher-level directional structure,
an extreme test versus recent price range,
a relative volume expansion filter,
a trend-strength condition,
and a momentum-fading condition.
The goal is to mark bars where the move into the extreme may be overextended and vulnerable to reversal.
Logic overview
The script evaluates five main components:
1) Macro directional bias
A Supertrend-derived direction is used as the main structural filter. This acts as the broader directional architecture around the trap event.
2) Extreme sweep detection
Price must reach beyond a recent local extreme:
for bearish trap logic, price pushes into the recent high range,
for bullish trap logic, price sweeps into the recent low range.
The lookback window for this sweep is controlled by the Extreme Lookback input.
3) Relative volume expansion
The script compares current volume against a moving average of volume and flags bars where volume expands beyond a user-defined multiplier.
This is used as a proxy for liquidation, stop-running, or abnormal participation.
4) Trend-strength filter
ADX must remain above a minimum threshold.
This helps avoid treating every small poke above or below a range as meaningful. The script is looking for sweeps that happen in a market with enough directional energy behind the move.
5) Momentum fade
MACD histogram behavior is used to detect whether momentum is no longer accelerating with the same strength.
This does not mean momentum has fully reversed already. It simply aims to capture early signs that the impulse may be losing efficiency.
Signal interpretation
A signal appears when the script finds a combination of:
directional structure,
sweep of a recent extreme,
elevated relative volume,
strong enough ADX,
and fading momentum.
A Bull Trap label marks a downside sweep that may be exhausting and becoming vulnerable to a reversal upward.
A Bear Trap label marks an upside sweep that may be exhausting and becoming vulnerable to a reversal downward.
These labels should be interpreted as context markers, not automatic trade commands.
Timeframe and architecture
The script supports a timeframe override, which allows the calculations to be performed on a selected timeframe instead of the chart timeframe.
This can be useful when the user wants a more stable structural read while viewing a lower timeframe chart.
The Macro EMA is included as an optional visual reference only.
It is not the trigger by itself, but can help users read whether the signal is appearing in a stretched or conflicting area relative to the chosen trend framework.
How to use
This indicator is generally more useful when treated as a reversal context tool rather than a standalone entry system.
Possible ways to use it:
identify sweep-and-fade zones after price attacks obvious highs or lows,
avoid late breakout chasing when a trap condition appears,
combine with market structure confirmation on a lower timeframe,
wait for reclaim / rejection / follow-through before acting,
use it as a filter alongside your own execution model.
Many users may find it more effective to wait for additional confirmation such as:
rejection wicks,
structure shift,
reclaim of prior level,
momentum turn on execution timeframe,
or a clear invalidation level.
Inputs
Macro EMA Length
Defines the EMA length for the optional macro trend reference line.
Supertrend Factor / Period
Controls the structural direction component.
Timeframe Override
Lets the user run calculations on a different timeframe than the current chart.
Extreme Lookback
Defines how far back the script looks to determine recent highs and lows.
Liquidation Vol Threshold
Sets the relative volume multiplier required to classify a bar as abnormal participation.
Min ADX
Minimum trend-strength threshold required before a trap can qualify.
Notes and limitations
This indicator does not predict every reversal, and it is not intended to label all stop-hunts perfectly.
Volume behavior, momentum behavior, and extreme sweeps can look different across markets and symbols.
Signals may behave differently depending on:
asset class,
session structure,
exchange volume quality,
and chosen timeframe.
For that reason, this script is best used as a decision-support tool within a broader trading framework, not as a guaranteed standalone system.
Practical reminder
A trap label does not automatically mean price must reverse immediately.
In strong trends, markets can continue to expand even after an apparent sweep.
Users should always define their own confirmation logic, invalidation rules, and risk management process.
Indicateur Pine Script®






















