Displacement Lens [JOAT]Displacement Lens
Introduction
The Displacement Lens is an advanced open-source momentum analysis indicator that measures real-time displacement intensity by fusing four normalized momentum oscillators with volume-weighted candle body analysis. It produces a composite displacement score displayed as a gradient histogram with adaptive threshold bands, designed to separate institutional displacement candles from retail noise. This is not a simple oscillator mashup — it is a unified displacement measurement engine with institutional-grade features built on top of the core signal.
The indicator operates in its own pane (non-overlay) and provides traders with a clear, visual representation of when price is being displaced by institutional force versus when it is drifting on low-conviction retail flow.
Why This Indicator Exists
Standard momentum oscillators like RSI, CCI, or Bollinger %B each capture only one dimension of market momentum. Traders often flip between multiple oscillators trying to get a complete picture. The Displacement Lens solves this by:
Normalizing four independent oscillators (BB %B, CCI, ROC, RSI) to a common scale so they can be meaningfully combined
Weighting the composite by volume intensity and candle body ratio — because a large-bodied candle on high volume is institutional displacement, while a small-bodied candle on low volume is noise
Adding adaptive threshold bands that adjust to the signal's own volatility, rather than using fixed overbought/oversold levels that fail in different market conditions
Layering institutional features on top: decay detection, accumulation phases, divergence scanning, exhaustion markers, and a per-bar institutional candle grade
The result is a single composite signal that tells you not just "is momentum bullish or bearish" but "how strong is the institutional displacement right now, and is it accelerating, decaying, or exhausting?"
Core Signal Construction
The displacement signal is built in three stages:
Stage 1: Oscillator Normalization
Each of the four oscillators is normalized to a range using methods appropriate to each:
Bollinger %B: Measures where price sits within the Bollinger Bands. The raw %B (0 to 1) is remapped to with a soft clamp. When price is above the upper band, the score approaches +1. Below the lower band, it approaches -1.
CCI: The Commodity Channel Index is divided by 200 and clamped. CCI values beyond +/-200 saturate at +/-1, while values near zero produce scores near zero.
ROC: Rate of Change is normalized using adaptive scaling — it divides by twice its own standard deviation over 50 bars. This means the normalization adapts to the instrument's typical momentum range.
RSI: Remapped from the standard 0-100 range to by subtracting 50 and dividing by 50. RSI 70 becomes +0.4, RSI 30 becomes -0.4.
Each oscillator can be individually toggled on or off, and the composite averages only the active ones.
Stage 2: Volume-Weighted Displacement
The oscillator composite is blended with a volume displacement component:
float vol_displacement = disp_direction * body_ratio * vol_intensity
float raw_signal = osc_composite * (1.0 - vol_weight) + vol_displacement * vol_weight
Where:
disp_direction is +1 for bullish candles, -1 for bearish
body_ratio is the candle body size divided by the full range (high-low) — institutional candles have ratios above 0.7
vol_intensity is current volume relative to the 20-bar average, clamped to
vol_weight (default 0.3) controls how much volume influences the final score
This means a strong oscillator reading on a small-bodied, low-volume candle gets dampened, while a moderate oscillator reading on a large-bodied, high-volume candle gets amplified.
Stage 3: Smoothing and Thresholds
The raw signal is smoothed with an EMA (default period 5), and adaptive threshold bands are calculated as the signal's own standard deviation multiplied by a configurable factor (default 1.5x over 100 bars). This creates bands that widen in volatile markets and tighten in calm markets — far more reliable than fixed thresholds.
Institutional Features
1. Displacement Impulse Signals
When the signal crosses above the upper threshold for the first time (with volume and body confirmation), a bullish impulse label appears. Similarly for bearish. These mark the exact moment institutional displacement begins — not after it has already played out.
2. Momentum Divergence Engine
The indicator detects four types of divergence between price pivots and signal pivots:
Regular Bearish: Price makes a higher high, but the displacement signal makes a lower high — momentum is weakening despite price advance
Regular Bullish: Price makes a lower low, but the signal makes a higher low — selling pressure is fading
Hidden Bearish: Price makes a lower high, but the signal makes a higher high — continuation of downtrend likely
Hidden Bullish: Price makes a higher low, but the signal makes a lower low — continuation of uptrend likely
Divergences are detected using configurable pivot lengths and drawn as labeled markers directly on the histogram.
3. Displacement Decay Zones
When the signal was above the upper threshold but starts declining (still positive, but fading), the indicator marks a "decay zone" — a dotted box on the histogram showing where institutional momentum is waning. This is a unique concept: it identifies the transition from impulse to drift before the signal crosses zero. Bear decay zones work identically on the downside.
4. Accumulation Phase Detector
When both the signal and signal line are near zero (below half the standard deviation) for a minimum number of bars, the indicator draws a dashed "accumulation" box. These low-displacement consolidation phases often precede the next major impulse move. The concept is borrowed from Wyckoff methodology but applied to displacement scoring rather than price.
5. Institutional Candle Grading
Every bar receives a grade from D to A+ based on three factors:
Body ratio (how much of the candle is body vs wick) — 33.3% weight
Volume intensity (current volume vs 20-bar average) — 33.3% weight
Displacement alignment (how far the signal is from the threshold) — 33.4% weight
A+ candles (score >= 80) with body ratio > 0.7 and volume > 1.5x average are flagged as true institutional candles. The grade is shown in the dashboard.
6. Velocity Channel
The rate of change of the displacement signal itself is plotted as a velocity line with standard deviation bands. When velocity is expanding (accelerating), the displacement move has conviction. When velocity contracts, the move is losing steam. Optional glow effects make the velocity channel visually distinct.
7. Exhaustion Detection
Bullish exhaustion fires when the signal was above the threshold for 3 consecutive bars and then declines for 3 consecutive bars. Bearish exhaustion is the mirror. These are rare, high-conviction reversal signals that mark the exact point where institutional displacement has peaked and is reversing.
8. HTF Displacement Bias
The indicator calculates the same displacement composite on a higher timeframe (default 4H) using request.security(). When the current timeframe signal aligns with the HTF bias, conviction is higher. The dashboard shows whether HTF is BULLISH, BEARISH, or NEUTRAL and whether it is aligned with the current signal.
9. Displacement Streak Counter
Tracks how many consecutive bars the signal has been above the upper threshold (bull streak) or below the lower threshold (bear streak). Longer streaks indicate sustained institutional pressure.
Visual Elements
Gradient Histogram: The main displacement signal plotted as columns with gradient coloring — bullish bars transition from muted teal to bright teal as strength increases, bearish bars from muted rose to hot rose. Volume spike bars are highlighted in amber.
Signal Line: A further-smoothed version of the signal (3x the smoothing period) plotted as a bright lavender line. Crossovers between the signal and signal line generate diamond markers.
Adaptive Threshold Bands: Upper and lower threshold lines that expand and contract with signal volatility.
Decay Zones: Dotted boxes marking fading institutional momentum.
Accumulation Zones: Dashed boxes marking low-displacement consolidation.
Velocity Channel: Rate-of-change line with glow bands showing displacement acceleration.
15-Row Dashboard: Comprehensive command center showing Signal value, Phase classification, Candle Grade, HTF Bias, Streak, Velocity, Divergence status, and more.
Input Parameters
Oscillator Components:
BB Length (default 20), BB Multiplier (default 2.0)
CCI Length (default 23), ROC Length (default 50), RSI Length (default 14)
Individual toggles for each oscillator
Displacement Engine:
Signal Smoothing (default 5) — EMA period for the final signal
Volume Weight (default 0.3) — how much volume influences the score
Threshold Lookback (default 100) — period for adaptive threshold calculation
Threshold Multiplier (default 1.5) — sensitivity of threshold bands
Institutional Features:
Toggles for Impulse Signals, Divergences, Decay Zones, Accumulation Phases, Signal Crossovers, Velocity Channel, Exhaustion Markers, HTF Bias
HTF Timeframe (default 240 / 4H)
Accumulation Min Bars (default 8), Decay Min Bars (default 5)
Max Boxes (default 30), Divergence Pivot Length (default 5)
How to Use This Indicator
Step 1: Read the Phase
The dashboard shows the current displacement phase: IMPULSE BULL, IMPULSE BEAR, DRIFT BULL, DRIFT BEAR, DECAY, ACCUMULATION, or FLAT. This tells you the market's current displacement state at a glance.
Step 2: Watch for Impulse Signals
When the signal crosses the threshold with volume confirmation, an impulse label appears. These are the highest-conviction displacement events — institutional money is moving price.
Step 3: Monitor Decay and Exhaustion
After an impulse, watch for decay zones forming. If the signal was strong and starts declining, the move is losing institutional backing. Exhaustion markers confirm the reversal point.
Step 4: Confirm with HTF Bias
Check whether the HTF displacement aligns with the current timeframe. Aligned signals have higher follow-through probability.
Step 5: Use Divergences for Reversals
Regular divergences warn of potential reversals. Hidden divergences confirm trend continuation. Both are detected automatically.
Step 6: Identify Accumulation for Breakout Setups
When the indicator marks an accumulation phase (low displacement for extended bars), prepare for the next impulse. The breakout direction is often confirmed by the first impulse signal after accumulation ends.
Limitations
The indicator measures displacement intensity, not price direction prediction. Strong displacement can occur in both breakouts and fakeouts.
Volume data quality varies by instrument and exchange. Forex volume on TradingView represents tick volume, not true volume.
HTF bias uses request.security() which may produce different results on different chart types.
Divergence detection requires sufficient pivot history — it will not fire on the first few hundred bars of a chart.
Exhaustion signals are intentionally rare (require 3 bars above threshold + 3 bars declining). They may not fire in fast-moving markets.
The indicator works best on liquid instruments with consistent volume patterns.
Past displacement patterns do not guarantee future price movement.
Originality Statement
This indicator is original in its unified displacement measurement approach. While individual oscillators (BB %B, CCI, ROC, RSI) are well-known, this indicator is justified because:
It normalizes four oscillators to a common scale using methods appropriate to each (adaptive scaling for ROC, division-based for CCI, remapping for RSI and BB %B) — not simply averaging raw values
The volume-weighted displacement component integrates candle body analysis with volume intensity, creating a measure that distinguishes institutional candles from retail noise
Adaptive threshold bands based on the signal's own standard deviation replace unreliable fixed thresholds
The Displacement Decay Zone concept — identifying the transition from impulse to drift before the signal crosses zero — is not available in standard oscillators
The Accumulation Phase Detector applies Wyckoff-inspired consolidation detection to a composite momentum score rather than price
The Institutional Candle Grading system scores every bar on three dimensions simultaneously (body, volume, displacement alignment)
The Velocity Channel measures the rate of change of displacement itself — a second derivative that reveals acceleration and deceleration of institutional activity
The combination of all these features with a comprehensive dashboard creates a unified displacement analysis system not available in any single existing indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
The displacement signal measures momentum intensity based on mathematical calculations of current and historical market data. It does not predict future price movement. High displacement does not guarantee profitable trades. Past displacement patterns do not guarantee future patterns.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions.
-Made with passion by officialjackofalltrades
Pine Script® indicator





















