Fragility-Weighted Liquidity Map Kyle Amihud RollFragility-Weighted Liquidity Map — Kyle · Amihud · Roll
What it is
A move of the same size means opposite things depending on the book beneath it. Into a thin book, a move is mostly price impact — mechanical, fragile, prone to snap back. Into a deep book, the same move took real participation and is more likely informed. This tool estimates how impact-driven the tape is right now from three classic microstructure measures, fuses them into one fragility read, and tints recent liquidity levels by it. It scales conviction and risk — it never picks a direction.
The three measures (all from OHLCV, peer-reviewed)
Kyle's lambda (Kyle 1985) — price impact per unit of signed volume: |price change over a window| ÷ |Σ sign(Δclose)·volume|. High λ = each unit of flow moves price a lot = thin, impactable.
Amihud illiquidity (Amihud 2002) — the average of |return| ÷ dollar-volume. High = small volume moves price a lot. (Empirically ~0.8 correlated with Kyle, so the two are blended, not double-counted.)
Roll implied spread (Roll 1984) — the effective spread implied by the bid-ask bounce: c = 2·√(−Cov(Δp, Δp₋₁)) when that covariance is negative. When it is positive — common in trends — the Roll model does not apply, so the estimate is shown as not measurable here rather than forced to a number. That honesty is deliberate.
Fusion → fragility
Each measure is ranked against its own recent history (a percentile), so the read self-tunes to the symbol and timeframe. The fragility index is the weighted blend of whichever measures are currently available (Roll drops out in trends, and the blend adapts). High fragility = impact-driven, reversible tape; low = deep, informed. A plain-language read suggests trusting breakouts less and fades more when fragility is high — as context, not a signal.
The map
Bars that trade unusually large volume leave a horizontal liquidity level where size changed hands. Each level is tinted by the fragility state at the moment it formed: warm = it printed in a thin/impact-driven tape (a weaker level, more likely to be swept); cool = it printed in a deep/informed tape (sturdier). So the map shows not just where liquidity sits but how trustworthy each pocket is.
How to use it
Add to any liquid symbol/timeframe; defaults suit index futures — change the price/volume sources for other markets.
Glance at the fragility lane — the thin strip at the pane bottom: red = thin/fragile, green = deep/solid, gray = normal. Risk-semantic colors (danger/safe), never direction. That strip alone answers "how careful should I be" for a non-technical user.
States are dwell-filtered (standard anti-chattering): a new THIN/DEEP/NORMAL is announced only after surviving a set number of bars, so the read doesn't flip-flop. STABILITY shows how settled it is; PENDING shows a forming state with a countdown. The cost is a few bars of lag — stated and adjustable.
The HTF STACK row shows the raw fragility state on three higher timeframes derived as multiples of the chart (defaults 3×, 5×, 15× — a 5m chart reads 15m/25m/75m automatically). ✓ green = all timeframes agree on the same actionable state; ⚠ amber = a higher timeframe reads the opposite state.
Read the dashboard: DEEP / NORMAL / THIN, the three measures' ranks, and a suggested size factor. As it turns THIN, treat moves as more reversible: size down, favour fades over breakout-chasing.
Use the rails as liquidity references coloured by trust — a warm rail formed in fragile conditions; a cool rail in solid ones.
Pairs with Order-Flow Criticality: that tool asks whether flow is self-exciting (endogenous); this asks whether the book is thin (impactable). Both elevated together is the genuinely fragile state.
What makes it original
Retail liquidity tools draw where volume traded. This one weights each level and the whole tape by how impactable it is, using three peer-reviewed microstructure estimators computed from bar data, self-calibrated, and — crucially — honest about when the Roll model doesn't apply. Reframing a liquidity map from "where is liquidity" to "how fragile is liquidity" is the contribution.
Concept credits
Price impact of order flow (lambda) — A. S. Kyle (1985). Illiquidity ratio — Y. Amihud (2002). Implied effective spread from serial covariance — R. Roll (1984). Square-root impact refinement — J. Hasbrouck. Fragility framing — general market-microstructure literature. Implementation and charting design are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. These are proxies estimated from bar data, not order-book truth, and they do not predict direction. Validate independently and manage your own risk. Indicator

Citadel Microstructure Edge [JOAT]CITADEL MICROSTRUCTURE EDGE
A tribute to the high-frequency / market-making style of microstructure-edge extraction. Builds three orthogonal microstructure signals — tick imbalance (which side is aggressively crossing the tape), spread tightness (how thin the bid-ask is relative to its baseline), and micro momentum (the EMA-pair spread on the fastest timeframe) — then composes them into a single decaying edge value with an exponential half-life. When the edge crosses a configurable threshold and has sustained for N bars same-sign, a directional signal fires. Cooldown plus asymmetric lockout keep the signal stream institutional.
Three orthogonal components
Each component is computed independently and Z-normalised (optional for tick imbalance) for stationarity:
Tick Imbalance — LTF-reconstructed buy/sell tick classification. Output is the rolling imbalance bounded in ; optionally Z-normalised over a configurable window (default 60 bars) for cross-asset stationarity. The dominant input for fast / scalping reads.
Spread Tightness — (H − L) / C against its own EMA-smoothed baseline, Z-scored. Tight spread (low relative range) is constructive for whichever side momentum favours. The sign is borrowed from the micro-momentum factor.
Micro Momentum — EMA-fast minus EMA-slow on the tick-reconstructed flow, Z-scored. The directional engine.
Default weights (0.45 / 0.25 / 0.45) bias the read toward the two most-actionable components (tick imbalance + momentum), with spread tightness as confirmation. Optional auto-normalisation to sum=1.
Decaying edge with half-life ~ 3 bars
Microstructure edges decay quickly. The script does not just sum the three components per bar — it accumulates with decay :
edge_t = decay × edge_{t−1} + contribution_t
The default decay (0.78) gives the edge a half-life of approximately 3 bars — the standard market-making decay window. Older contributions fade out automatically; new contributions get incorporated immediately. This is the institutional way to track a fast signal without re-introducing flicker.
Sustained-edge signal logic
Edge Threshold (default 0.75) — minimum |edge| magnitude required to fire.
Sustained Edge (default 5 bars same sign) — the edge must have held its sign for N consecutive bars before a signal fires. This is the script's most important false-positive filter.
Cooldown (default 7 bars) — minimum bars between signals.
Asymmetric lockout (default ON) — an opposite-side signal CAN fire during cooldown. This means a quick flip from buy to sell remains responsive while consecutive same-side signals are suppressed.
Visual system
Edge histogram — projected at the top of the chart at a configurable percent of price (default 2% of price, 1.2% top padding). Histogram columns are coloured by edge sign with magnitude-proportional intensity. At a glance you see the edge's recent trajectory.
Buy / Sell labels with optional Unicode lightning glyph (toggleable to plain ">").
Slope-tinted micro ribbon — the micro fast / slow EMAs plotted with a translucent fill coloured by spread sign. Toggleable.
Subtle background shade by edge sign (off by default).
A locked Crimson Pulse palette: electric blue buy edge / lime-yellow sell edge / muted neutral on a deep crimson-black ground — the institutional HFT aesthetic.
Dashboard
9-row monospaced table positionable to any of nine corners. Surfaces:
Edge value with status (BUY / SELL / FLAT).
Tick imbalance value.
Spread tightness Z.
Micro momentum Z.
Sustained-edge counter (how many consecutive same-sign bars).
Last signal direction with bars-ago.
Decay setting and effective half-life.
Cooldown remaining.
Configuration: LTF, weights, threshold.
Alerts
Three alert conditions, each independently controllable:
Edge Buy
Edge Sell
Sustained Edge (N bars same sign) — the script's headline alert; fires before the signal does, useful as an early-warning notification.
{image]https://www.pulsewire.com/x/ybVYCAr3/
How to read it
Three reads, in order of conviction:
Sustained edge into a structural level — the highest-conviction read. The microstructure has been one-sided for N+ bars AND price is at a known S/R; the next move into the level usually breaks it.
Edge buy / sell with all three components agreeing — fast directional commitment. The dashboard's per-component rows tell you whether the read is dominated by tick imbalance (aggressive tape) or by micro momentum (sustained direction) or by spread tightness (regime-aware confirmation).
Edge above threshold but not sustained — early-warning state. Edge has crossed threshold but the sustained counter has not yet reached N. Watch the counter — if it ticks up bar-by-bar, the signal is forming; if it drops, the edge is decaying.
Suggested settings
Defaults (1m LTF, spread EMA 14 / Z 60, micro EMA 3/8 / Z 60, weights 0.45/0.25/0.45, edge threshold 0.75, sustain 5 bars, decay 0.78, cooldown 7 bars) are tuned for 5m–15m charts on liquid futures and crypto where microstructure has meaningful presence. For 1m scalping drop LTF to 15s (Premium required) and sustain to 3 bars. For HTF the script is not the right tool — microstructure edges decay too quickly to be meaningful on 1H+ timeframes.
Originality
The implementation — the three-component microstructure pipeline (tick imbalance + spread tightness + micro momentum), the LTF tick-rule reconstruction with optional Z-normalisation, the weighted-sum composition with auto-normalisation, the exponential-decay edge accumulator with configurable half-life, the sustained-edge counter and asymmetric-lockout signal logic, the price-anchored histogram render at the top of the chart, the slope-tinted micro ribbon, and the Crimson Pulse palette — is JOAT-original. No third-party code reused. The script is a tribute to Citadel-style market-making microstructure-edge extraction, not a direct replication of any proprietary Citadel code.
Limitations
Reconstructed tick direction is an inference — the tick rule is the accepted public-market proxy but is not a direct read of bid/ask. Sub-minute LTFs require a PulseWire Premium or Ultimate plan. Microstructure edges decay fast by design; on 1H+ timeframes the engine produces few signals — that is correct behaviour, not a bug.
—
-made with passion by jackofalltrades
Indicator

Market Microstructure Pulse [JOAT]MARKET MICROSTRUCTURE PULSE
A composite microstructure oscillator that fuses three lower-timeframe-reconstructed flow primitives into a single bounded pulse line — the tick imbalance, the aggressive ask/bid streak, and the single-bar massive imbalance event. The pulse tells you in one number whether buyers or sellers are currently dominant at the tape level, and whether that dominance is at warning or extreme intensity.
Lower-timeframe reconstruction
Real microstructure lives below the chart timeframe. The pulse engine pulls intrabar prints from a configurable LTF (default 1 minute; auto-mode picks ~1/20 of the chart TF) and classifies each tick via the standard tick rule. The classified ticks are then EMA-smoothed by a configurable pulse length (default 14) and optionally volume-weighted (default ON) so a heavy print contributes proportionally more to the read than a light one.
The output is a smoothed signed value bounded approximately in where:
+1 — all recent ticks were buy-classified.
−1 — all recent ticks were sell-classified.
0 — perfectly balanced flow.
Aggressive streak histograms
Two separate counters track consecutive same-side ticks — one for aggressive asks, one for aggressive bids. When a streak exceeds the Aggressive Streak Min threshold (default 5), it qualifies as institutional persistence. The two histograms are rendered as a colour-coded background to the pulse line so you can see at a glance which side has been running consecutively. EMA-smoothed for visual stability.
Massive imbalance event
A single-bar event: when one side's share of total bar volume exceeds imbalancePct (default 80%), a Massive Imbalance event fires. This is the script's strongest single-bar read — institutional decisiveness landing on the tape.
Two-tier threshold system
Pulse Warning — |pulse| above the warning threshold (default 0.50). Inner band, visual reference.
Pulse Extreme — |pulse| above the extreme threshold (default 0.70). Triggers the Pulse Extreme alert and tints the chart background.
A toggleable Aggression Flip Marker prints a glyph at the bar where the pulse sign actually flips — useful for catching the moment dominance rotates sides.
Visual system
Pulse line in the iridescent palette (magenta buy / cyan sell) with configurable width.
Aggressive streak histograms — two-sided coloured columns behind the pulse (transparency configurable).
Threshold levels at ±warning and ±extreme (toggleable).
Gradient fill from pulse line to zero, coloured by current sign (transparency configurable).
Background tint on extreme — magenta or cyan tint when |pulse| is above extreme threshold (transparency configurable).
Aggression flip markers at sign-change bars (toggleable).
A locked Iridescent palette (magenta buy aggression / cyan sell aggression / yellow extreme accent on pure black) gives the pane a distinctive cyberpunk-tape identity.
Dashboard
Monospaced 11-row table positionable to any of nine corners. Surfaces:
Current pulse value with sign.
Buy streak count and sell streak count.
Aggressive side dominance with bar age.
Last extreme event direction with bars-ago.
Last flip direction with bars-ago.
Last massive imbalance event with bars-ago.
LTF in use, volume-weighting flag, pulse EMA length.
Threshold values for warning and extreme.
Alerts
Three alert conditions, each independently controllable:
Pulse Extreme — fires when |pulse| crosses above extreme threshold.
Aggression Flip — fires when pulse sign flips (positive ↔ negative).
Massive Imbalance — fires when a single bar's directional share exceeds the imbalance threshold.
How to read it
Three reads, in order of conviction:
Massive Imbalance alert at a structural level — the highest-conviction single read. Institutional decisiveness landed on the tape at a known S/R; the next directional move is more conviction-aligned with the imbalance side.
Pulse Extreme + matching aggressive streak — sustained dominance. The pulse is decisively past its extreme threshold AND the streak histograms show consecutive same-side runs above the streak minimum. This is the regime where momentum tools have their largest edge.
Aggression Flip after extreme — exhaustion read. The pulse hit extreme then flipped sign; the institutional commitment that drove the extreme has just rotated. Often produces clean reversals.
Suggested settings
Defaults (1m LTF, pulse EMA 14, streak EMA 7, volume-weighted ON, ±0.50 / ±0.70 thresholds, 80% imbalance, 5-tick streak min) are tuned for 5m–15m charts on liquid futures and crypto. For lower-timeframe scalping, drop LTF to 15s or 30s (Premium plan required) and pulse EMA to 8. For HTF, set LTF auto-mode and raise streak min to 10. The volume-weighting is the recommended default — without it, equal-tick instruments dominate the read regardless of size.
Originality
The implementation — the LTF tick-rule reconstruction with optional volume weighting, the bounded pulse formulation, the dual aggressive-streak histograms with EMA smoothing, the two-tier (warning / extreme) threshold system, the single-bar massive-imbalance detector, the aggression-flip marker logic, the chart-overlay extreme tinting, and the iridescent dual-hue palette — is JOAT-original. No third-party code reused. The pulse is the original composite formulation.
Limitations
Reconstructed tick direction is an inference — the tick rule is the accepted public-market proxy but it is not a direct read of bid/ask volume. Sub-minute LTFs require a PulseWire Premium or Ultimate plan. The pulse is bounded approximately in but extreme volume-weighted reads can briefly exceed those bounds; this is intentional and not a bug. EMA smoothing introduces a small lag; turn pulse length to 1 to see the raw imbalance.
—
-made with passion by jackofalltrades
Indicator

VPIN Flow-Toxicity OscillatorVPIN Flow-Toxicity Oscillator
What it does
The VPIN Flow-Toxicity Oscillator is a single-pane order-flow toxicity gauge, scaled 0–100. It rises when estimated buy/sell volume becomes one-sided and "informed" — a condition that historically tends to precede volatility expansion and liquidity events, regardless of direction.
Why this is different (and original)
This is not a directional momentum or volume oscillator. It is an early-warning for volatility. Where most volume tools sum or net volume, VPIN measures the imbalance between estimated buy and sell volume and ranks how toxic (one-sided) flow currently is. The key property — documented in the microstructure literature — is that toxic flow tends to lead range expansion, so the oscillator can light up while price is still quiet. Delivering VPIN as a clean, self-calibrating 0–100 line with an honest volatility-expansion edge test (not a directional one) is what makes it original.
How it works
Bulk-Volume Classification splits each bar's volume into buy and sell using the normal CDF of the standardized price change (Φ of the price move divided by its rolling standard deviation).
Toxicity = rolling mean of |buy − sell| ÷ rolling mean of volume over the window (a 0–1 figure).
That figure is percentile-ranked over the percentile window into a 0–100 line, so the toxic and extreme thresholds self-calibrate to each instrument.
How to use it
Low (green) = calm, balanced flow. High (red) = toxic, one-sided flow — tighten risk and expect a range expansion, not a particular direction.
A cross above the Toxic threshold (triangle) is the warning event; the Extreme zone is a stronger version.
Read the EDGE row. Because VPIN signals volatility (not direction), the harness measures whether high toxicity actually preceded a range expansion — the high−low range over the horizon reaching ≥ k×ATR — versus the unconditional Base %. EDGE = Hit − Base. This is the honest test of the metric's stated claim.
Important honesty note
This is the bar-based bulk-volume approximation of VPIN. Charts do not provide exchange-classified aggressor (true buy/sell) data, so buy/sell split is estimated from price and volume. It is a faithful, widely-used approximation — but it is an approximation, and the indicator says so.
Settings guide
01 · VPIN Engine — return-sigma length, toxicity window, percentile window, universal price source.
02 · Calibration — horizon, expansion threshold (×ATR range), base-rate window.
03 · Bands — calm, toxic and extreme percentile thresholds.
04 · Display & Theme — visual style, regime tint, dashboard, colors.
Non-repaint
Classification uses closed bars only — no future leak.
Concept credit
Volume-synchronized Probability of Informed Trading (VPIN) and bulk-volume classification — Easley, López de Prado & O'Hara, Flow Toxicity and Liquidity in a High-Frequency World (2012).
Disclaimer
For research and education only. Not financial advice, not a recommendation, and not a guarantee of future results. VPIN signals toxicity and potential volatility, not direction. All statistics are in-sample and exclude costs. Do your own research and manage your own risk. Indicator

Order Flow Microstructure Engine# Order Flow Microstructure Engine
**Order Flow Microstructure Engine** condenses a full stack of order-flow and market-microstructure measures into a single decision: one confidence %, one tier, and one action with entry/stop levels — shown in an adaptive on-chart dashboard. It is built to answer one question on every bar: *are aggressive buyers or aggressive sellers in control, and how convinced should you be?*
This is not a bundle of unrelated indicators placed on one chart. Every component measures a **different facet of the same process** — the buy/sell auction happening inside each bar — and they are combined inside **one probabilistic model**. The reason for the mashup, and how the parts interact, is described below as the guidelines require.
**Why these components are combined (mashup justification)**
No single order-flow measure is reliable alone: raw delta misleads during absorption, CVD drifts, footprint imbalances appear in chop, and toxicity rises at both reversals and breakouts. Because these weaknesses are *partially independent*, fusing the measures correctly cancels noise that any one of them carries. The original element is **how** the fusion is done — not what is plotted.
**How it works (the pipeline)**
1. *Reconstruction.* Lower-timeframe sub-bars are pulled and each is classified buy/sell with a tick-rule cascade (after Lee & Ready). Where the data plan exposes native volume footprint, real bid/ask is used and aggregated into the same price bins. The dashboard always shows whether it is running on reconstructed (`RECON`) or native (`NATIVE`) data.
2. *Factors.* From that base it derives Aggressor Imbalance Ratio, Cumulative Volume Delta, footprint imbalances/POC, auction Value-Area efficiency (acceptance vs rejection), integrated multi-level Order-Flow Imbalance (depth-weighted), VPIN-style flow toxicity, Kyle's lambda price-impact/liquidity, a directional self-exciting (Hawkes) intensity, and a square-root-law absorption measure.
3. *Fusion (the original part).* Each factor is mapped to a probability and combined in Bayesian log-odds. Crucially, the flow-derived factors are **decorrelated before fusion** using an effective-sample-size (design-effect) shrinkage, so factors that are really the *same evidence* (AIR, delta, CVD, footprint, OFI) cannot inflate confidence just by agreeing. Structurally independent factors (auction efficiency, MOC, Hawkes, absorption, cross-instrument) enter at full weight. The posterior is then gated by multi-timeframe and multi-horizon consensus and damped by a regime-thrash (chop) penalty, producing one confidence → a 5-tier ladder → an action.
Without this combination you would get several conflicting opinions; the value is the **correlation-aware fusion** that turns them into one calibrated read.
**How to use it**
- Apply to a liquid instrument on an intraday timeframe (1m–1h). Defaults are tuned for index futures on 5-minute charts with 5-second sub-bars.
- Read the Compact dashboard top-down: ACTION + confidence %, Tier (position-size guidance), Entry/Stop, then CO-FIRE confluence, multi-timeframe and regime/stability. Switch "Table view mode" to Full for a complete factor-by-factor breakdown.
- On-chart triangles mark Tier-1/Tier-2 long/short signals across history; footprint boxes show the intrabar buy/sell distribution.
- For other markets: change the **Market preset** (group 01). Choose **CUSTOM** to set your own session, MOC window, footprint bin sizing and CVD reset — making it usable on any instrument in any market.
- The dashboard theme auto-adapts to a light or dark chart background.
**What makes it original**
Correlation-aware decorrelated Bayesian fusion of order-flow factors; a native-footprint seam that uses real bid/ask when available and transparently falls back to reconstruction; layered multi-horizon + multi-timeframe + cross-instrument confirmation on a microstructure base; and a regime-stability filter that penalizes only genuine directional reversals, not same-direction intensity changes.
**Honesty / limitations**
On most retail feeds, order flow here is reconstructed from lower-timeframe data via the tick rule (~75–80% trade-sign accuracy), not true exchange bid/ask, unless your plan provides native footprint data. The data source is shown in the dashboard. This is an analytic and educational tool, not financial advice and not a guarantee of results.
**Concept credits**
Lee & Ready (trade sign); Kyle (price impact / lambda); Easley, López de Prado & O'Hara (VPIN); Cont, Kukanov & Stoikov and Xu, Gould & Howison (OFI / multi-level OFI); Hawkes and Bacry–Muzy (self-exciting intensity); Almgren and Tóth–Bouchaud (square-root impact law); Kaufman (Efficiency-Ratio adaptation); Steidlmayer (Market Profile / Value Area); Kish (design effect). All Pine implementations are original re-derivations; no external script code is used.
**Disclaimer**
For research and educational purposes only. Nothing here is financial advice. Markets carry risk and past behaviour does not guarantee future results. Always do your own research and manage risk.
Indicator

Order Flow Imbalance Regime Engine# Order Flow Imbalance Regime Engine
## OVERVIEW
The Order Flow Imbalance Regime Engine reconstructs a proxy for **order-flow imbalance** (net aggressive buying vs selling) directly from price and volume, scales it into an **expected price move**, and turns it into a connected set of read-outs: directional pressure, price impact, multi-horizon conviction, self-excitation (cascade) intensity, a three-lens liquidity-stress score, optional cross-asset confirmation, and a probability distribution over five market regimes. It runs on **any symbol and any market** — equities, futures, forex, crypto, indices — including instruments without reliable volume.
A charting platform exposes no Level-2 order book, so true exchange-grade OFI is not computable. This engine is an honest **approximation** that rebuilds buy/sell pressure from intrabar tick direction, probabilistic bulk classification, or candle geometry — not from limit-order placements and cancellations.
## WHY THE COMPONENTS BELONG IN ONE SCRIPT (not a mashup of unrelated tools)
Every stage is derived from **one underlying quantity** — reconstructed buy-vs-sell pressure — and each stage consumes the previous stage's output, all feeding a single end product (the regime probabilities). They are dependencies in a chain, not independent indicators placed side by side:
1. **Classification** reconstructs buy/sell pressure (tick rule, bulk volume, or geometry).
2. **Stationarization** standardizes that exact series so values compare across assets.
3. **Price impact (Kyle λ)** scales the standardized flow into an expected price move — large imbalance against thin depth implies a bigger move.
4. **Multi-horizon consensus** measures the same series across timescales for conviction.
5. **Self-excitation (Hawkes)** tests whether the imbalance is clustering — flow that triggers more flow.
6. **Liquidity stress** estimates fragility (the *context* that makes impact larger or smaller).
7. **Cross-asset confirmation** checks whether a correlated instrument agrees.
8. **Regime classifier** is a softmax that takes features 1–7 as inputs and outputs probabilities. Remove any earlier stage and the classifier loses an input — that dependency is the justification for combining them.
## HOW EACH STAGE WORKS
- **Classification (choose one):**
- *Intrabar Tick Rule* — pulls lower-timeframe bars inside each candle and tags each buy or sell by its own open/close.
- *Bulk Volume Classification (BVC)* — splits each bar's volume probabilistically using the normal CDF of its standardized return; designed for bar-aggregated data and consistent with the VPIN liquidity layer.
- *Candle Geometry* — splits volume by where the close sits within the bar's range.
- On volume-less instruments it falls back to a tick count, so the imbalance stays meaningful.
- **Stationarized OFI (z-score):** standardizes raw imbalance over a lookback so +2 means "two standard deviations of buying" on any asset.
- **Price impact (Kyle λ):** estimates λ by regressing bar return on signed flow; market depth ≈ 1/λ. The dashboard's **Expected Move** is λ · OFI, expressed in ATR units — this reproduces the founding result that price impact scales inversely with depth.
- **Multi-horizon consensus:** three EMAs of the z-score; agreement of their signs (shown as n/3) gauges conviction.
- **Self-excitation (Hawkes):** an intensity that jumps on strong imbalance events and decays exponentially — λ(t) = λ(t-1)·e^(-β) + α·event. Reported as a 0–100 percentile (Cascade Strength) plus direction.
- **Liquidity stress:** the mean percentile of three orthogonal lenses — VPIN-style flow toxicity, a thin-book "vacuum" term (price travelling far on thin relative volume), and Amihud illiquidity (|return|/volume). Using three independent estimators avoids resting the read on any single one.
- **Cross-asset confirmation:** a lagged imbalance proxy on a user-chosen correlated symbol; used only to confirm, never as a stand-alone signal.
- **Round-level magnet (optional, heuristic):** distance to the nearest auto-scaled round level as a crude pinning gauge. **This is explicitly not options dealer gamma**, which needs options open-interest data unavailable on a price chart.
- **Regime classifier:** a softmax over the above producing probabilities for Trend Continuation, Squeeze, Cascade Blast, Mean Reversion, and Liquidity Shock; the dominant one is highlighted.
## HOW TO USE IT
- Works best on intraday timeframes where intrabar data exists (1m–1h); it also runs higher via the geometry/BVC paths.
- **Dashboard:** read Buy/Sell pressure for direction, OFI z-score and consensus for strength/conviction, **Expected Move** for the impact-scaled magnitude, Cascade for clustering, Liquidity Stress for fragility, and the highlighted Regime for context.
- **Signals:** a triangle prints on the first bar of a buy or sell cascade (strong, directionally-aligned self-excitation, optionally confirmed by the cross-asset). Treat these as context/timing aids, not stand-alone entries.
- **Tuning:** switch Classification method to compare tick-rule vs BVC; lower Squeeze sensitivity on compression-prone instruments; set the Volume source and cross-asset reference to suit your instrument.
## WHAT MAKES IT ORIGINAL
Most published "order flow" tools stop at a single buy-minus-sell histogram. This engine (a) offers **three interchangeable classification methods** including probabilistic bulk classification, (b) **stationarizes** the imbalance for cross-asset comparability, (c) scales it into a **Kyle-λ expected move** rather than leaving it as a raw count, (d) adds an explicit **self-exciting (Hawkes) cascade** layer, (e) fuses **three orthogonal liquidity lenses** into one stress score, and (f) routes everything through a **softmax regime classifier** that outputs a probability distribution rather than a binary signal. The volume-agnostic fallback and theme-adaptive dashboard make it genuinely universal. The code is an independent implementation and reuses no third-party scripts.
## DATA, UNIVERSALITY & SETTINGS
The Volume source input, three classification methods, and automatic tick/geometry fallbacks let the engine run on any market, including volume-less instruments. The cross-asset reference defaults to a NIFTY-family symbol (BANKNIFTY) but is freely editable to any correlated instrument, and the round-level spacing auto-scales or accepts manual values, so the engine adapts to any exchange or instrument.
## REPAINTING DISCLOSURE
Intrabar and cross-asset requests update on the live (forming) bar, so live read-outs can change until the bar closes. The "Confirm signals on bar close" option (ON by default) makes all plotted signals and alerts evaluate only on closed bars, so historical signals are fixed and non-repainting.
## ACADEMIC CREDIT
This script is an original implementation of concepts from public research, with thanks to their authors: Cont, Kukanov & Stoikov (order-flow imbalance and linear price impact, 2014); Kyle (the λ price-impact coefficient and market depth, 1985); Xu, Gould & Howison (multi-level order flow, 2018); Cont, Cucuringu & Zhang (integrated and cross-asset OFI, 2023); the Generalized/Stationarized OFI literature; Lee & Ready (tick-rule trade classification, 1991); Easley, López de Prado & O'Hara (Bulk Volume Classification and VPIN flow toxicity, 2012); Amihud (the illiquidity measure, 2002); the Hawkes self-exciting process literature (Bacry, Muzy, and others); and Kolm, Turiel & Westray (multi-horizon order-flow alpha, 2023).
## DISCLAIMER
This indicator is provided for research and educational purposes only. It is not financial, investment, or trading advice and makes no promise of profitability. Order-flow imbalance here is an approximation, not exchange-grade Level-2 data. Trading involves substantial risk of loss; past behaviour does not guarantee future results. You are solely responsible for your own decisions.
Indicator

Liquidity Map & Execution Cost# Liquidity Map & Execution Cost
## What this script does
LMX answers three execution questions most indicators ignore: **how expensive is it to get in and out right now, how hard would it be to move size, and where on the chart will price struggle versus travel freely.** It reads only the chart's own price and volume — no symbol is hardcoded, so it runs on any asset and any market (equities, futures, FX, crypto, indices) — and turns the answers into a plain-language trade check: liquidity state, suggested position size, order type, estimated slippage, and a colour-coded map of support, resistance, walls and open gaps.
## Why these components are combined (mashup justification)
This is not several indicators stacked together — it is one liquidity model whose parts each answer a question the others cannot, and they are designed to be read together. Removing any one leaves a specific blind spot:
1. **Cost to cross — effective spread.** Estimated with the EDGE estimator (Ardia, Guidotti & Kroencke 2024) from open/high/low/close, cross-checked against Abdi-Ranaldo (2017) and Corwin-Schultz (2012). This tells you the round-trip cost of entering, which spread-blind tools cannot show. Alone, it says nothing about moving size or about levels.
2. **Cost to move size — price impact.** The Amihud (2002) illiquidity ratio with a high-low refinement, plus a rolling Kyle (1985) lambda computed as a true regression slope. This tells you how far your own order would push price — the question that matters for sizing, and one a spread estimate cannot answer.
3. **Direction of pressure — order imbalance.** A close-location signed-volume imbalance and its persistence. This tells you which side is leaning now, adding direction that the cost measures lack.
4. **The spatial map — volume at price.** A time-decay-weighted, range-distributed volume profile that yields the Point of Control and Value Area (standard 70% method), rendered as directional zones: green support below price, red resistance above, solid = a wall price struggles at, faint = an open gap price slides through. This converts the abstract cost/impact numbers into *locations* on the chart.
5. **Anchored VWAP — fair value.** A volume-weighted average anchored to your chosen reference (last major swing by default; or session/week/month open, or the highest-volume bar), drawn as a trend-coloured line. It is the dynamic counterpart to the static profile: where the average participant is positioned, and whether price is rich or cheap versus that.
Together they form one decision: the spread and impact set the **cost and size**, the imbalance and VWAP set the **direction and fair value**, and the map sets the **location** — so the output is "trade full size with market orders, buyers in control, room to run up to the gap above," not five separate readings.
## How a reading is produced
Each estimator is normalised to a percentile of its own history so thresholds adapt to every symbol and timeframe. The inverted spread, inverted impact and depth combine into a 0–100 **Liquidity Score**, classified as Deep / Normal / Thin / Stressed (a sudden impact spike forces Stressed). The score drives the suggested size multiplier, the order-type advice and the slippage estimate. The map is rebuilt on the last bar from the volume-at-price profile.
## How to use it
- Apply to any symbol. Set the price source and, if you trade very low intraday timeframes, optionally fix the calc timeframe (e.g. Daily) so the spread estimators stay stable. On symbols without real volume the volume modules disable automatically and the score leans on the spread estimators (the panel shows "price-only").
- **Simple mode (default)** gives plain-language guidance: Liquidity, Trade cost, Pressure, Position size, Orders, Watch-out, Fair value, and a one-line verdict. **Pro mode** exposes the full readout (spread in bps, Amihud and Kyle percentiles, depth, imbalance, flow persistence, value-area levels).
- On the chart: trade toward green support, expect resistance at red, size down where the map is thin (price moves fast there), and read the trend-coloured fair-value line for rich/cheap context.
- Alerts: liquidity-state change and sudden liquidity withdrawal.
## Originality
The combination is the original contribution: a single overlay that fuses low-frequency **spread**, **impact** and **imbalance** estimators with a **time-decay, range-distributed volume profile** and an anchored fair-value line, then translates all of it into sizing/order/slippage decisions in plain language. The building blocks are public-domain methods (EDGE, Abdi-Ranaldo, Corwin-Schultz, Amihud, Kyle, volume-profile Value Area, anchored VWAP), each used for the specific job described above and cited in the script header.
## Limitations (please read)
- These are **low-frequency estimators** of quantities normally measured from quote/tick data. They approximate — they do not measure — the true spread, depth, or dealer book.
- Volume-based modules require a real volume feed; they disable on symbols without one.
- Spread estimators were validated on daily-type bars; on very fast intraday timeframes they are noisier — use the calc-timeframe option if needed.
- The on-panel statistics are computed on the loaded chart history.
- This is an analysis tool, **not financial advice.** Test before use and trade at your own risk.
Indicator

Order Flow Asymmetry [JOAT]Order Flow Asymmetry
Introduction
Order Flow Asymmetry is an open-source synthetic institutional order flow indicator that tracks four independent measures of directional institutional activity — Volume-Weighted Momentum, Liquidity Vacuum detection, Microstructure Imbalance scoring, and a dynamic Information Ratio Band system — and classifies the current market into one of four regime states based on trend direction and volatility level. Smart money signals are generated only when regime, VWM direction, imbalance score, and the absence of a liquidity vacuum all align simultaneously.
The core thesis is that institutional participants leave statistical footprints in price and volume data that can be approximated without access to full order book data. When a large participant is absorbing supply, the result is: above-average volume, below-average price movement, high close-to-range ratio biased toward the institutional direction, and a cumulative imbalance in the bid-side proxy. Order Flow Asymmetry tracks these proxies simultaneously rather than relying on any single measure.
Core Concepts
1. Volume-Weighted Momentum (VWM)
VWM weights each bar's price change by its volume — large-volume bars contribute more to the running total than small-volume bars. The cumulative result is then normalized relative to the 20-bar average volume, producing a -50 to +50 reading:
float vwm = ta.cum(ta.change(close) * volume) / ta.ema(volume, 20)
float vwmNorm = (vwm - ta.lowest(vwm,100)) / math.max(ta.highest(vwm,100) - ta.lowest(vwm,100), 1e-9) * 100 - 50
A crossover of zero in either direction is the primary momentum signal.
2. Liquidity Vacuum Detection
A liquidity vacuum occurs when volume collapses below two standard deviations of its 50-bar mean while price moves more than one ATR in the same bar. This pattern indicates a move through a region with no counterparty liquidity — a potential institutional trap. Vacuum bars are marked with three-layer glow boxes and treated as signal inhibitors.
3. Microstructure Imbalance Score
A bar-level bid/ask proxy is computed from close position within the high-low range. Bars closing in the upper half of their range contribute positive imbalance; bars closing in the lower half contribute negative. A 93% decay factor is applied each bar, producing a running imbalance score that emphasizes recent activity while retaining historical context.
4. Four-State Regime Classification
The regime is determined by two binary conditions: ADX above threshold (trending vs. ranging) and ATR ratio above threshold (high vs. low volatility). This produces four states: Trend Bull, Trend Bear, Range High-Vol, Range Low-Vol. Each state receives a distinct background tint. Smart money signals require a Trend state — signals in Range states are suppressed.
5. Information Ratio Bands
Standard deviation bands are computed from the MIDAS VWAP. The band width multiplier is dynamically set by the rolling Sharpe ratio estimate of recent returns — periods with higher risk-adjusted returns produce narrower bands, while periods with lower Sharpe ratios produce wider bands.
float sharpe = ta.ema(ret20, 20) / math.max(ta.stdev(ret20, 20), 1e-8)
float kFactor = math.max(0.5, math.min(3.0, math.abs(sharpe) * 2))
Features
Volume-Weighted Momentum: Cumulative volume-weighted price change normalized to -50/+50 range
Institutional VWAP center line: Thick reference line showing the cumulative volume-weighted average price anchor — the central institutional value reference
VWM gradient fill zones: Bull zone fills between VWAP and upper VWM level in bull theme color; bear zone fills between VWAP and lower VWM level in bear theme color — intensity reflects VWM magnitude
IR Band gradient fill: Subtle gradient fill between upper and lower Information Ratio bands shows the full Sharpe-adjusted deviation range
Regime transition markers: Every regime change draws a vertical dotted line plus a direction label (▲ TrendBull / ▼ TrendBear / ◆ RngHVol / ◇ RngLVol) — institutional regime context at a glance
Absorption / Distribution labels: "Absorption" label when cumulative microstructure imbalance score exceeds extreme threshold; "Distribution" label when it falls below. Identifies potential institutional accumulation/distribution zones
Smart money signal markers: "▲ SMART LONG" / "▼ SMART SHORT" labels with embedded VWM and Imbalance values, plus a vertical dotted line through each signal bar for visual alignment
Liquidity vacuum detection: Volume collapse + ATR-relative move identifies institutional trap zones with 3-layer glow visualization and "Vacuum" text label
Microstructure imbalance score: Decaying cumulative bid/ask proxy normalized by ATR, displayed in dashboard
Four-state regime classification: Trend Bull / Trend Bear / Range High-Vol / Range Low-Vol from ADX and ATR ratio — distinct background tints for each state
Information Ratio Bands: VWAP deviation bands with width dynamically set by rolling Sharpe estimate
Gradient candle coloring by VWM: Bar colors reflect normalized VWM intensity using color.from_gradient() when VWM exceeds threshold in trend direction
Three-layer glow candles (optional): Institutional-style neon glow candle effect
12-row institutional dashboard: Regime, VWM, vacuum state, imbalance score, Sharpe k-factor, IR band levels, signal, win rate, and performance stats
Four color themes: Phantom, Neon, Classic, Solar
Non-repainting: All signals gated by barstate.isconfirmed; all inputs are historical only
Input Parameters
Volume-Weighted Momentum:
Volume Average Length (default: 20)
VWM Cross Threshold (default: 5.0)
Liquidity Vacuum:
Volume Mean Length, Sigma Below Mean, Vacuum Zone Width, Glow Strength
Microstructure Imbalance:
Imbalance Decay Factor (default: 0.93)
Imbalance Signal Gate (default: 15.0)
Regime Classification:
ADX Trend Threshold (default: 25)
ATR Ratio High-Vol Threshold (default: 1.2)
Information Ratio Bands:
Show IR Bands toggle
Sharpe Window (default: 20)
Signal:
Cooldown Bars, TP ATR Multiple, SL ATR Multiple, Show Trade Block, Block Width
How to Use This Indicator
Step 1: Identify the Regime
Check the dashboard Regime row. Smart money signals only fire in Trend Bull or Trend Bear states. During Range states, no signals are generated regardless of VWM direction.
Step 2: Watch for VWM Zero Cross
The VWM crossing zero in the direction of the trend regime is the primary trigger. Ensure no vacuum is active on the signal bar — vacuum bars inhibit signals because they represent suspect moves without genuine counterparty support.
Step 3: Check Imbalance Score
The imbalance score reflects cumulative directional bias in bid/ask proxy. A score above the gate threshold in the trend direction adds confidence. A score contradicting the trend direction is a warning.
Step 4: Use IR Bands as Dynamic Reference
The Information Ratio bands widen in low-Sharpe environments (price distributing far from VWAP) and narrow in high-Sharpe environments (price efficiently priced near VWAP). These bands serve as dynamic reference levels rather than fixed targets.
Indicator Limitations
VWM uses tick volume as a proxy for institutional participation. On forex spot and some crypto venues, tick volume may not accurately represent actual participation
The microstructure imbalance score uses bar close position as a bid/ask proxy. This is an approximation — actual bid-ask data is not available in standard PulseWire data
Regime classification uses ADX and ATR ratio, both of which lag price. A trend beginning explosively will be classified as ranging for several bars until indicators respond
The Information Ratio Band width is driven by a 20-bar Sharpe estimate, which is an extremely short window for a reliable Sharpe computation. It should be interpreted as a dynamic band-width scaler rather than a statistically significant Sharpe ratio
Smart money signals are rare by design — the four-condition gate produces low-frequency output
Originality Statement
The combination of Volume-Weighted Momentum, Liquidity Vacuum detection as a signal inhibitor, a decaying Microstructure Imbalance score, and Information Ratio Bands with Sharpe-driven width — all gated by a four-state regime classification — is an original analytical architecture not replicated in existing open-source Pine Script v6 publications
Treating liquidity vacuums as signal inhibitors rather than signals themselves — suppressing momentum signals that occur immediately after a volume-collapse move — is a novel application of vacuum detection logic
Dynamic VWAP deviation band width driven by a rolling Sharpe ratio estimate rather than a fixed multiplier provides adaptive band boundaries that reflect the current efficiency of price relative to VWAP
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Synthetic order flow measures are approximations that use publicly available price and volume data as proxies for actual institutional activity. Past signal performance does not predict future results. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
Indicator

Meridian Imbalance Ledger [JOAT]Meridian Imbalance Ledger
Introduction
Meridian Imbalance Ledger is an open-source imbalance mapping tool that tracks confirmed chart-timeframe, higher-timeframe, and micro-structure fair value gaps inside one coordinated framework. The script is designed to answer three practical questions: where imbalance was created, whether that imbalance is still active, and how price is behaving when it returns to those zones.
The indicator solves a context problem. Many imbalance tools only mark a gap once and leave the trader to manually judge whether it remains relevant. Meridian instead maintains a living ledger of active zones, inversion status, fill progress, age, and structural pressure so the chart shows which imbalances still matter and which ones have been consumed.
Core Concepts
1. Multi-source imbalance detection
Meridian separates imbalance generation into three sources:
Chart timeframe imbalances
Higher-timeframe imbalances requested with non-repainting offset logic
Optional micro-structure imbalance scans from lower-timeframe data
This allows a trader to see whether current price is interacting with local inefficiency, inherited higher-timeframe inefficiency, or smaller sub-bar displacement inside the current bar structure.
2. Fill progress and retirement logic
Each zone remains active until its fill rule is satisfied. The script supports configurable retirement behavior so zones can be treated as mitigated on a simple touch, midpoint interaction, or deeper body-based invalidation depending on the chosen rule set.
3. Inversion tracking
If price meaningfully breaches an imbalance, the zone can be treated as structurally altered rather than simply forgotten. Meridian keeps inversion state so prior bullish inefficiency can become resistance context and prior bearish inefficiency can become support context.
4. Age and pressure weighting
Not all zones deserve equal weight. Meridian tracks zone age and active count to create a pressure ratio that helps communicate whether bullish or bearish imbalance structure is dominating the chart right now.
Features
Chart, HTF, and micro imbalance layers: Multiple imbalance sources displayed in one coordinated ledger
Non-repainting HTF requests: Higher-timeframe data requested using historical offsets for safer confirmed context
Fill-progress tracking: Zones remain active until their configured retirement condition is met
Inversion state handling: Breached imbalances can remain visible as flipped structural context
Age-aware zone fading: Older zones visually decay to reduce clutter while retaining context
Pressure ratio and active counts: Quick read on whether bullish or bearish imbalance pressure is leading
Compact top-right dashboard: Displays counts, inversion totals, micro scan status, and bias ratio
Confirmed-bar alerts: New imbalance, inversion, and state transitions only trigger on confirmed bars
How to Use This Indicator
Step 1: Identify whether current price is trading inside fresh chart-timeframe imbalance or approaching older inherited imbalance from a higher timeframe.
Step 2: Use the dashboard counts and bias ratio to judge whether current imbalance structure is skewed toward support or resistance.
Step 3: Monitor inversion states. A previously bullish zone that has failed cleanly may become useful resistance context on retests.
Step 4: Treat micro imbalance scans as execution detail, not a standalone trend signal. The broader chart and HTF layers should carry more decision weight.
Limitations
Micro-structure scans depend on lower-timeframe availability and plan limits
HTF imbalances are intentionally delayed by one completed HTF bar to reduce repaint risk
An imbalance zone is contextual, not a guarantee of reversal or continuation
Originality Statement
Meridian Imbalance Ledger is original in the way it combines confirmed chart imbalances, non-repainting higher-timeframe imbalance inheritance, optional micro scans, and zone lifecycle management into one stateful framework. The script is intended as a structured market context layer, not a one-click entry signal.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not provide financial advice or trade recommendations. Imbalance reactions can fail, invert, or be ignored entirely by the market. Always use independent confirmation and risk management.
Indicator

Market Pressure Route [AGPro Series]Market Pressure Route
🌊 Overview
─────────────────────────────────────────────────
Market Pressure Route visualizes the directional buying/selling pressure of a market as a flowing route that tracks price from above or below, and classifies the texture of that flow in real time as Clean, Stalling, Exhausted, or Broken. It is a visualization and classification tool built around two original analytics: the Directional Pressure Score (DPS) and the Route Continuity Index (RCI). The route does not predict price — it describes how clean, consistent, and energetic the current pressure is, so you can read the order-flow texture at a glance.
🔹 Unique Edge
─────────────────────────────────────────────────
Most pressure, flow, or delta-style indicators collapse to a single oscillator or histogram and leave the trader to interpret the number. Market Pressure Route takes a different route.
• Dual-layer engine — DPS measures how directional pressure is; RCI measures how consistent that pressure has been over a lookback window. Pressure without continuity is noise; continuity without pressure is drift. Only the combination qualifies as a Clean route.
• Route, not oscillator — the analytic flows as a colored band above or below price. You read the texture of the market in the same place you read price, not in a separate pane.
• Four-state classification — Clean, Stalling, Exhausted, Broken. Every bar lands in exactly one state, driven by a deterministic decision tree. No grey zones, no ambiguous signals.
• Magnitude-gated break detection — a sign flip in pressure only counts as a Broken route when the flip happens with enough energy. This suppresses the low-amplitude zero-line noise that plagues most flow tools.
• Institutional-grade presentation — compact AGPro panel with live state, direction, DPS bar widget, RCI, and a continuity Flow bar. Badges only mark the transitions that change the market story; Stall and Exhaust transitions are conveyed by route color alone.
🔹 Methodology
─────────────────────────────────────────────────
Directional Pressure Score (DPS) — a composite bounded in blending four bar-level microstructure components:
• Body (45%): closing conviction within the bar range
• Close Location (25%): close position relative to the bar midpoint
• Volume (20%): clamped z-score of volume vs a 50-bar baseline
• Gap (10%): open-to-prior-close gap, ATR-scaled
The raw score is clamped to and then EMA-smoothed with the Pressure Length.
Route Continuity Index (RCI) — a score combining:
• Persistence (65%): fraction of bars in the lookback whose DPS sign matches the current sign
• Stability (35%): one minus the normalized dispersion of DPS across the window
Stability is calibrated for the bounded range of DPS so that RCI remains resolute and does not saturate near 1.0 on quiet markets.
State Classification — a deterministic ternary decision tree:
• Broken — the pressure sign has just flipped with magnitude above the Broken Minimum DPS. Held for up to five bars as a cooldown so the transition is visible.
• Clean — qualifies via either a magnitude path (|DPS| above Clean DPS threshold and RCI above Clean RCI threshold) or a continuity path (RCI above 0.75 with minimum pressure above the Stalling DPS threshold). The dual path handles rally/selloff asymmetry.
• Stalling — pressure still present (|DPS| above Stalling threshold) but continuity has weakened (RCI below Clean levels).
• Exhausted — pressure has faded below the Stalling threshold or is losing magnitude.
🔹 Signals & Alerts
─────────────────────────────────────────────────
State transitions are exposed in two places:
On-chart badges:
• CLEAN UP — bullish Clean route has just formed
• CLEAN DOWN — bearish Clean route has just formed
• BROKEN — pressure direction has just flipped with magnitude
Intermediate Stall and Exhaust transitions are conveyed by route color change only, keeping the chart uncluttered. A price-clustering filter suppresses repeated same-type badges in the same zone so sideways markets stay institutional.
Alerts (both alert() calls and alertcondition() entries):
• Clean Bullish Route
• Clean Bearish Route
• Route Stalling
• Route Exhausted
• Route Broken
🔹 Key Inputs
─────────────────────────────────────────────────
Core Analytics:
• Pressure Length — EMA length applied to DPS (default 14)
• Route Smoothing — visual smoothing for the route band only (default 3)
• Route Continuity Lookback — bars used to compute RCI (default 10)
• Strict Route Filter — raises Clean thresholds by 0.10 for higher timeframes
Classification Thresholds:
• Clean DPS / Clean RCI — magnitude-path qualification levels
• Stalling DPS — minimum pressure to stay out of Exhausted
• Broken Minimum DPS — magnitude gate for break detection
Visual:
• Show Route Band, Minimal Mode, Price Tint
• Route Band Offset in ATR units
• Show State Badges toggle
Panel:
• Show Panel, Location (five positions), Font Size (Tiny to Large)
• Label Font Size
🔹 How to Use
─────────────────────────────────────────────────
• Context reading — the route color tells you what kind of flow you are in before you take any decision. A bright green or pink route with a strong Flow bar is a clean regime; a grey route is an exhausted regime.
• Transition awareness — BROKEN badges mark moments where the pressure narrative has changed with energy. Use them as context signals, not as entries.
• Higher-timeframe bias — many users enable Strict Route Filter on the daily and weekly to isolate only the strongest Clean routes, then drop to intraday for execution.
• Works on any liquid market with reliable volume: crypto, majors in FX, indices, and large-cap equities. Low-volume pairs dilute the volume component of DPS.
🔹 Limitations & Transparency
─────────────────────────────────────────────────
• This is a classification and visualization tool. It does not forecast price, it does not generate buy or sell orders, and it is not a strategy.
• DPS relies on a reliable volume series. Instruments with synthetic or missing volume will weight the volume component poorly.
• Route color and state describe the current bar's classification and update in real time. Final state for any bar is determined at bar close.
• No indicator identifies every turn in the market. Clean routes can exhaust without breaking; Broken routes do not guarantee a reversal of price.
🔹 Risk Disclosure
─────────────────────────────────────────────────
This script is provided for educational and analytical purposes only. It is not financial advice, not a trading recommendation, and not a solicitation to buy or sell any asset. Trading involves significant risk, including the possible loss of principal. Past performance and historical signal behavior do not guarantee future results. Always perform your own research and risk management, and size your positions according to your own risk tolerance. Indicator

[uPaSKaL] Momentum Structure CandlesMomentum Structure Candles
Momentum Structure Candles is an intrabar-based framework built to show how momentum develops inside each higher timeframe bar.
Instead of reducing momentum to a single line or value, the script reconstructs the internal structure of the bar using lower timeframe data and displays it as a momentum candle. The result is a structural view of direction, stability, expansion, and internal pressure.
🔹 What It Shows
Traditional momentum tools focus on outcome.
Momentum Structure Candles focuses on formation.
Two bars can close in the same direction while having completely different internal behavior:
one builds smoothly
one expands early and fades
one confirms late
one remains internally mixed
This script helps reveal:
whether momentum is building cleanly or fragmenting
whether pressure is stable or unstable
whether late-bar activity confirms or weakens the move
whether the bar is structurally directional or internally rotational
🔹 Intrabar Momentum Reconstruction
The script requests lower timeframe OHLC data and converts it into momentum-relative values using a configurable lookback.
Those intrabars are then aggregated into a synthetic momentum candle that represents the internal structure of the active bar.
This allows you to read:
momentum range
internal pullbacks
final position within the structure
balance versus expansion
🔹 Last-Bar Magnifier
The magnifier expands the current bar into its lower timeframe momentum structure, making it easier to read how the candle is forming in real time.
Useful for:
tracking acceleration or slowdown during bar development
spotting late confirmation versus late failure
avoiding over-reliance on the final candle close
🔹 Volume-Weighted Momentum
Momentum can optionally be weighted by volume to distinguish between:
low-participation movement
stronger momentum backed by active participation
similar structures with different internal conviction
🔹 Anchored Mode
The script can also run in anchored cumulative mode.
In this mode, momentum is accumulated and reset on a selected anchor period, creating a session-style structural model similar to a cumulative flow framework.
This is useful for:
tracking persistent directional pressure
identifying compounding momentum
spotting early loss of structure after expansion
🔹 Heatmap Context
An optional heatmap normalizes current momentum strength relative to recent conditions, helping highlight:
strong expansion versus ordinary movement
active versus passive conditions
high-energy momentum regimes
🔹 Phase Analysis
The current bar can be split into:
Early
Mid
Late
This helps answer a key question:
When was momentum strongest inside the bar?
It can reveal:
early push followed by failure
late expansion after consolidation
internal transitions hidden by the final close
🔹 Additional Notes
Built from lower timeframe structure, not standard price candles
Includes optional Light and Dark visual themes
Best used for structural reading, timing, and execution context
🔹 Practical Use Cases
confirm whether a move is structurally strong or only visually strong
detect weakening momentum before price structure shifts
evaluate continuation versus exhaustion
analyze pullbacks as corrective or structural
monitor the live development of the active bar
combine with liquidity, structure, or SMC-based execution models
🔹 Final Note
Momentum Structure Candles is not built to replace price.
It is built to expose the internal momentum architecture that standard candles hide.
By reconstructing intrabar structure, optionally weighting by volume, supporting anchored cumulative behavior, and providing a real-time magnifier, the script turns momentum into a readable structural process rather than a compressed output.
Indicator

Institutional Footprint Scanner [JOAT]Institutional Footprint Scanner
Introduction
The Institutional Footprint Scanner (IFS) is an advanced open-source order flow analysis indicator that detects institutional trading activity through multi-dimensional market microstructure analysis. This indicator combines Order Flow Toxicity Index, Volume Profile with Point of Control (POC), Absorption Coefficient analysis, Smart Money Divergence detection, Liquidity Void identification, Footprint Clustering, Tape Reading metrics, and Iceberg Order detection to reveal when large institutional players are actively positioning in the market.
Unlike basic volume indicators that simply show volume bars, IFS quantifies institutional behavior through sophisticated algorithms that analyze aggressive vs passive order flow, volume distribution across price levels, absorption patterns, market depth proxies, and hidden liquidity. The indicator synthesizes these multiple perspectives into a unified confidence score and visualizes institutional activity through a dynamic 9-layer gradient ribbon, color-coded chart overlays, and a comprehensive real-time dashboard.
Why This Indicator Exists
This indicator addresses the challenge of identifying institutional order flow in real-time without access to Level 2 order book data. When large institutional players enter positions, they create detectable signatures across multiple market dimensions. IFS systematically detects these patterns to reveal:
Order Flow Toxicity: Measures aggressive vs passive flow to identify when institutions are aggressively taking liquidity
Volume Profile Analysis: Identifies Point of Control (POC), Value Area High/Low, and high/low volume nodes
Absorption Coefficient: Quantifies institutional absorption strength when high volume produces minimal price movement
Market Microstructure: Analyzes spread dynamics and market depth to detect market maker behavior
Smart Money Divergence: Detects multi-oscillator divergences (RSI, MFI, CVD) indicating institutional positioning
Liquidity Void Detection: Identifies areas with no institutional interest (low volume + narrow range)
Footprint Clustering: Tracks and clusters institutional footprints to identify accumulation/distribution zones
Tape Reading Metrics: Simulates Level 2 order book analysis through aggressive/passive volume classification
Iceberg Order Detection: Identifies hidden institutional liquidity through repeated absorption at same price levels
9-Layer Gradient Ribbon: Visualizes order flow intensity through dynamic color-coded ribbon around institutional VWAP
Institutional Dashboard: Displays 13+ real-time metrics including confidence, toxicity, absorption, POC distance, and more
Each component provides unique intelligence. Toxicity shows aggressive flow, Volume Profile shows price acceptance, Absorption shows institutional positioning, Microstructure shows market maker behavior, Divergence shows smart money positioning, and Clustering shows conviction. Together, they create a comprehensive institutional detection system.
Core Components Explained
1. Order Flow Toxicity Index
The Toxicity Index measures the ratio of aggressive order flow (market orders taking liquidity) vs passive flow (limit orders providing liquidity). The algorithm analyzes each candle's closing position within its range to classify order flow:
Aggressive Buy Flow: Candles that close in the top 25% of their range (above 75% threshold) with volume are classified as aggressive buying. This indicates buyers are urgently taking liquidity by hitting ask prices, pushing price toward the high.
Aggressive Sell Flow: Candles that close in the bottom 25% of their range (below 25% threshold) with volume are classified as aggressive selling. This indicates sellers are urgently taking liquidity by hitting bid prices, pushing price toward the low.
Passive Flow: Candles closing in the middle 50% of their range are classified as passive flow, indicating balanced limit order activity without urgency.
The system accumulates volume-weighted flow over the lookback period (default: 20 bars) and calculates toxicity ratios. When buy toxicity exceeds threshold (default: 0.7 or 70%), it signals institutions are aggressively accumulating. When sell toxicity exceeds threshold, it signals aggressive distribution.
High toxicity indicates institutional urgency - large players are willing to pay the spread and move price to establish positions quickly, typically preceding significant directional moves.
2. Volume Profile with POC Detection
IFS calculates a volume profile by dividing the price range into bins (default: 20 bins) and accumulating volume at each price level over the lookback period (default: 100 bars). This creates a histogram showing which price levels attracted the most trading activity.
How Volume Profile Works:
The algorithm divides the price range (highest high to lowest low) into equal-sized bins. For each historical bar, it determines which bin the price falls into and adds that bar's volume to the bin's total. After processing all bars, the result is a distribution showing volume concentration across price levels.
Point of Control (POC): `The price level with the highest accumulated volume`. This represents the price where the most trading occurred - a critical support/resistance level. Institutions often defend POC levels because they represent fair value where significant positions were established.
Value Area High (VAH) and Value Area Low (VAL): These define the range containing approximately 70% of total volume. The Value Area represents the price range where the majority of trading activity occurred. Price outside the Value Area is considered at extremes.
Trading Significance:
When price approaches POC (within 2% by default), expect strong support or resistance. POC acts as a magnet - price tends to gravitate toward high-volume nodes. When price is above VAH, it's in overbought territory. When below VAL, it's in oversold territory. Inside the Value Area indicates balanced, fair-value trading.
The indicator tracks POC distance in real-time and displays it in the dashboard, alerting traders when price approaches this high-probability reversal zone.
3. Absorption Coefficient Analysis
The Absorption Coefficient quantifies institutional absorption by measuring volume intensity relative to price movement. This reveals when large players are accumulating or distributing positions without moving price significantly.
How Absorption Works:
The algorithm calculates two key ratios:
Body Ratio: Measures the candle body size relative to total range. A small body ratio (close near open) indicates price didn't move much despite trading activity.
Volume Ratio: Compares current volume to the 20-bar average. A high volume ratio (2x, 3x, or more) indicates elevated trading activity.
Absorption Calculation:
Absorption coefficient = Volume Ratio × (1 - Body Ratio)
This formula produces high values when volume is elevated BUT price movement is minimal. This is the signature of institutional absorption - large players are patiently absorbing available liquidity at a specific price level without pushing price away.
Directional Absorption:
The system determines direction based on candle color. Bullish candles (close > open) produce positive directional absorption, indicating institutional buying. Bearish candles produce negative directional absorption, indicating institutional selling.
Trading Significance:
High absorption (above 0.75 by default) indicates institutions are positioning. When combined with high volume but minimal price movement, it suggests large players are absorbing all available liquidity at current levels. This often precedes significant moves once absorption is complete and institutions begin actively moving price.
4. Market Microstructure Analysis
IFS analyzes market microstructure through spread dynamics and depth proxies to detect market maker behavior and order book depth without requiring Level 2 data.
Spread Analysis:
The algorithm calculates the candle range (high - low) as a percentage of close price, then compares it to the average spread over the lookback period (default: 20 bars). The spread z-score measures how many standard deviations current spread is from average.
Tight Spreads (< 70% of average): Indicate market makers are actively providing liquidity. This is normal, healthy market conditions where bid-ask spreads are narrow and order book depth is good. Tight spreads suggest low risk and stable conditions.
Wide Spreads (> 150% of average): Indicate market makers are withdrawing liquidity. This occurs during risk-off events, before major moves, or when institutions are positioning. Wide spreads signal caution - liquidity is drying up and volatility may spike.
Depth Proxy:
The system estimates order book depth by calculating volume relative to spread. High volume with tight spreads indicates deep order book - many limit orders providing liquidity. Low volume with wide spreads indicates shallow order book - few limit orders, high slippage risk.
Market Maker Activity Detection:
The indicator classifies market maker behavior as "Providing" (tight spreads, deep market), "Withdrawing" (wide spreads, shallow market), or "Neutral". Market maker withdrawal often precedes significant moves as institutions clear out liquidity before pushing price.
Trading Significance:
Deep markets with tight spreads are ideal for entries - low slippage, good liquidity. Shallow markets with wide spreads require caution - entries may experience significant slippage. Market maker withdrawal signals potential volatility ahead.
5. Smart Money Divergence Engine
IFS detects divergences across multiple oscillators (RSI, MFI, Cumulative Volume Delta) to identify when smart money is positioning against the prevailing price trend. Divergences reveal hidden strength or weakness not visible in price action alone.
Three Oscillators Analyzed:
RSI (Relative Strength Index): Measures momentum on a 0-100 scale. RSI above 70 indicates overbought, below 30 indicates oversold. RSI divergence shows momentum weakening despite price movement.
MFI (Money Flow Index): Similar to RSI but volume-weighted, measuring money flow pressure. MFI divergence shows money flow weakening despite price movement, indicating institutions are not participating in the move.
CVD (Cumulative Volume Delta): Tracks cumulative buy vs sell volume. Positive CVD indicates net buying pressure, negative indicates net selling. CVD divergence shows order flow weakening despite price movement.
Bullish Divergence Detection:
Occurs when price makes lower lows BUT oscillators make higher lows. This indicates selling pressure is weakening despite lower prices - smart money is accumulating while retail panics. Requires 2+ oscillators confirming for high-probability signal.
Bearish Divergence Detection:
Occurs when price makes higher highs BUT oscillators make lower highs. This indicates buying pressure is weakening despite higher prices - smart money is distributing while retail chases. Requires 2+ oscillators confirming for high-probability signal.
Trading Significance:
Multi-oscillator divergence (2 or 3 oscillators confirming) is one of the most reliable reversal signals. It reveals that while price appears to be trending, the underlying momentum, money flow, and order flow are deteriorating. This often precedes major reversals as smart money has already positioned for the turn.
6. Liquidity Void Detection
Liquidity voids are areas with minimal institutional interest, identified by the combination of low volume and narrow price range. These zones represent areas where institutions are not interested in trading, creating vacuums that price moves through quickly.
How Void Detection Works:
Low Volume Threshold: Volume must be below (average - 1 standard deviation) to qualify as low volume. This ensures volume is statistically low, not just slightly below average.
Narrow Range Threshold: The candle range (high - low) must be less than 50% of the average range. This indicates price consolidation with minimal movement.
Liquidity Void Confirmation: Both conditions must be met simultaneously - low volume AND narrow range. This combination indicates no institutional interest at current price levels.
Consecutive Void Tracking:
The system tracks consecutive void bars. When 3+ consecutive bars meet void criteria, it signals a significant liquidity void. These multi-bar voids are particularly important as they represent extended periods of institutional disinterest.
Trading Significance:
Liquidity voids should be avoided for entries. When price revisits void zones, it typically moves through them quickly with minimal support or resistance - there's no institutional interest to slow price movement. Voids often become gaps on higher timeframes or result in fast, one-directional price action.
Traders should wait for price to exit void zones before entering positions. Voids can also be used as targets - if entering below a void, expect price to move quickly through the void to the next area of institutional interest above it.
7. Footprint Clustering Analysis
IFS tracks institutional footprints (high-confidence absorption or toxicity events) and identifies clusters where multiple footprints occur within a short time period. Clustering indicates sustained institutional conviction rather than isolated events.
How Clustering Works:
Footprint Tracking: Every time the indicator detects institutional activity (absorption + toxicity + high confidence), it records a "footprint" with the bar index and type (buy or sell). The system maintains a rolling history of the last 50 footprints.
Cluster Detection: The algorithm counts how many footprints occurred within the cluster distance (default: 15 bars) of the current bar. If 3+ footprints are found within this window, a cluster is detected.
Dominant Type Classification: The system analyzes the types of footprints in the cluster. If more buy footprints than sell footprints, it's classified as a "Bullish Cluster" (accumulation zone). If more sell footprints, it's a "Bearish Cluster" (distribution zone).
Trading Significance:
Footprint clusters reveal areas where institutions repeatedly positioned over multiple bars. This indicates conviction - not a single large order, but sustained accumulation or distribution.
Bullish clusters (3+ buy footprints within 15 bars) suggest institutions are building long positions in this price zone. These areas often become strong support levels.
Bearish clusters (3+ sell footprints within 15 bars) suggest institutions are building short positions or distributing longs. These areas often become strong resistance levels.
Clusters with 5+ footprints indicate extreme institutional conviction and are the highest-probability support/resistance zones.
8. Tape Reading Metrics
IFS simulates Level 2 order book tape reading by analyzing candle position within its range combined with volume intensity. This reveals whether orders are aggressive (taking liquidity) or passive (providing liquidity) without requiring actual order book data.
How Tape Reading Works:
Candle Position Calculation: Measures where the close is within the candle's range. Position = (close - low) / (high - low). A value of 1.0 means close at high, 0.0 means close at low, 0.5 means close at midpoint.
Aggressive Buy Detection:
Occurs when candle closes in top 20% of range (position > 0.8) AND close > open AND volume exceeds 20-bar average. This indicates buyers aggressively hit ask prices, pushing price to the high. Institutions are urgently taking liquidity on the buy side.
Aggressive Sell Detection:
Occurs when candle closes in bottom 20% of range (position < 0.2) AND close < open AND volume exceeds 20-bar average. This indicates sellers aggressively hit bid prices, pushing price to the low. Institutions are urgently taking liquidity on the sell side.
Passive Absorption Detection:
Occurs when candle closes in middle 20% of range (position 0.4-0.6) AND volume exceeds 1.5x the 20-bar average. This indicates high volume but price didn't move much - institutions are patiently absorbing liquidity at current levels without pushing price away.
Trading Significance:
Aggressive buying/selling indicates institutional urgency - large players are willing to pay the spread and move price to establish positions quickly. This often precedes continued directional movement.
Passive absorption indicates institutional patience - large players are absorbing all available liquidity at a specific price level. This often occurs at support/resistance where institutions defend levels. Once absorption is complete, price typically reverses or breaks through.
9. Iceberg Order Detection
Iceberg orders are large hidden institutional orders that absorb liquidity repeatedly at the same price level. The name comes from the iceberg analogy - only a small portion is visible in the order book, while the bulk remains hidden. IFS detects icebergs by identifying repeated passive absorption at the same price.
How Iceberg Detection Works:
Passive Absorption Tracking: The system monitors for passive absorption events (high volume, mid-range close). Each time passive absorption occurs, it records the price level.
Price Proximity Check: When a new passive absorption event occurs, the algorithm checks if it's at the same price as the previous event. "Same price" is defined as within 0.2% (20 basis points) to account for minor price fluctuations.
Hit Counter: If absorption occurs at the same price level, the hit counter increments. If absorption occurs at a different price (more than 0.2% away), the counter resets and tracking begins at the new price.
Iceberg Confirmation: When 3+ passive absorption events occur at the same price level, an iceberg order is detected. This indicates a large hidden order is repeatedly absorbing all available liquidity at this specific price.
Trading Significance:
Iceberg orders represent major institutional interest at a specific price level. They act as strong support (buy icebergs) or resistance (sell icebergs).
Buy icebergs indicate institutions are defending a price level - every time price drops to this level, the iceberg absorbs all selling pressure. This creates a floor that's difficult to break.
Sell icebergs indicate institutions are capping price - every time price rises to this level, the iceberg absorbs all buying pressure. This creates a ceiling that's difficult to break.
Iceberg detection provides high-probability entry zones (buy near buy icebergs) and exit zones (sell near sell icebergs). When icebergs are finally consumed (price breaks through), it often results in explosive moves as the major support/resistance is removed.
10. Confidence Score System
IFS calculates a multi-factor confidence score to quantify signal quality:
float confidence = 0.0
confidence += strong_absorption ? 25.0 : 0.0
confidence += (toxic_buy_flow or toxic_sell_flow) ? 20.0 : 0.0
confidence += deep_market ? 15.0 : 0.0
confidence += (bull_div or bear_div) ? 20.0 : 0.0
confidence += in_cluster ? 10.0 : 0.0
confidence += near_poc ? 10.0 : 0.0
bool high_confidence = confidence >= min_confidence // Default 75%
Confidence score combines all detection methods. Scores above 75% indicate high-probability institutional activity. Scores above 90% indicate extreme conviction.
11. 9-Layer Gradient Ribbon Visualization
The gradient ribbon visualizes order flow intensity through 9 transparent layers between institutional VWAP and a wave level:
float vwap_inst = ta.vwap(hlc3)
float flow_intensity = math.min(confidence / 100, 1.0)
float toxicity_intensity = math.abs(toxicity_imbalance)
float combined_intensity = (flow_intensity + toxicity_intensity) / 2.0
float wave_ratio = math.min(0.65, combined_intensity)
float wave_level = vwap_inst + ((close - vwap_inst) * wave_ratio)
// 9 layers with progressive transparency
float ribbon_step = (wave_level - vwap_inst) / 9.0
Ribbon color indicates direction (gold for institutional buy, indigo for institutional sell). Ribbon intensity increases with confidence and toxicity. The VWAP line itself changes color dynamically based on institutional activity.
Visual Elements
Institutional VWAP Line: Dynamic color (gold for inst buy, indigo for inst sell, matrix green for toxic buy, hot pink for toxic sell)
9-Layer Gradient Ribbon: Progressive transparency showing order flow intensity around VWAP
Toxicity Heatmap: Background gradient (hot pink to orange) showing toxicity intensity
Absorption Wave Zones: Dynamic boxes showing absorption strength (gold for buy, indigo for sell)
Cluster Intensity Zones: Background coloring (matrix green for bullish, hot pink for bearish) with intensity based on cluster size
Liquidity Void Highlighting: Dark zones indicating areas with no institutional interest
Toxicity Flow Lines: Dynamic gradient lines showing flow direction and intensity
Absorption Flow Lines: Gradient lines showing absorption strength and direction
Microstructure Spread Bands: Circles showing market depth (blue for deep, orange for shallow)
Institutional Footprint Markers: "INST" labels at high-confidence footprints with detailed tooltips
Toxicity Level Labels: "TOXIC BUY/SELL" labels at extreme toxicity events
Absorption Strength Labels: "ABS" labels showing absorption coefficient
Cluster Formation Labels: "CLUSTER" labels marking significant footprint clusters
POC Proximity Labels: "POC" labels when price approaches Point of Control
Liquidity Void Labels: "VOID" labels marking significant voids
Iceberg Order Markers: "◆ ICE" diamond markers at iceberg detection
Market Maker Activity Labels: "MM OUT" labels when market makers withdraw liquidity
Bar Coloring: Gradient bar colors based on institutional activity intensity
Dashboard: Real-time institutional metrics in top-right corner (13+ metrics)
Input Parameters
Order Flow Analysis:
Toxicity Lookback: Period for toxicity calculation (default: 20, range: 10-50)
Toxicity Threshold: Threshold for toxic flow detection (default: 0.7, range: 0.5-0.9)
Volume Profile:
Volume Profile Bins: Number of price bins for volume distribution (default: 20, range: 10-50)
VP Lookback Period: Bars to analyze for volume profile (default: 100, range: 50-200)
POC Sensitivity: Distance threshold for POC proximity (default: 0.02, range: 0.01-0.05)
Market Microstructure:
Spread Analysis Period: Lookback for spread analysis (default: 20, range: 10-50)
Depth Threshold: Multiplier for deep market detection (default: 1.5, range: 1.0-3.0)
Footprint Detection:
Min Absorption Coefficient: Minimum absorption for detection (default: 0.75, range: 0.5-1.0)
Cluster Distance: Bars to consider for clustering (default: 15, range: 5-30)
Minimum Confidence %: Minimum confidence for signals (default: 75%, range: 60-95%)
Visualization:
Show Order Flow Ribbon: Toggle 9-layer gradient ribbon display
Show POC Levels: Toggle Point of Control level display
Show Footprint Markers: Toggle institutional footprint labels and markers
How to Use This Indicator
Step 1: Monitor Dashboard Confidence
Watch the dashboard confidence score in the top-right corner. Scores above 75% indicate high-probability institutional activity. Scores above 90% indicate extreme conviction.
Step 2: Identify Institutional Footprints
Look for "INST" labels (gold for buy, indigo for sell) marking high-confidence institutional footprints. Hover over labels to see detailed metrics including confidence, absorption coefficient, and toxicity.
Step 3: Check Order Flow Toxicity
Monitor the Toxicity row in the dashboard. "BUY" with high value indicates aggressive institutional buying. "SELL" with high value indicates aggressive institutional selling. Toxicity above 0.7 is significant.
Step 4: Analyze Absorption Coefficient
Check the Absorption row in the dashboard. Values above 0.75 indicate strong institutional absorption. Look for "ABS" labels on the chart showing absorption events. High absorption with minimal price movement indicates institutions are positioning.
Step 5: Use Volume Profile Context
Monitor POC Distance in the dashboard. When price approaches POC (distance <2%), expect strong support/resistance. Check Value Area position - price outside value area is at extremes. Look for "POC" labels when price approaches Point of Control.
Step 6: Watch for Footprint Clusters
Look for "CLUSTER" labels indicating 3+ footprints within cluster distance. Bullish clusters suggest institutional accumulation. Bearish clusters suggest institutional distribution. Cluster zones are highlighted with background coloring.
Step 7: Monitor Market Microstructure
Check the Spread and Depth rows in the dashboard. Deep markets with tight spreads indicate healthy liquidity. Shallow markets with wide spreads indicate market maker withdrawal. "MM OUT" labels warn of liquidity withdrawal.
Step 8: Identify Iceberg Orders
Watch for "◆ ICE" diamond markers indicating iceberg order detection. These mark hidden institutional liquidity providing strong support/resistance. Iceberg orders indicate institutions are patiently absorbing at specific price levels.
Step 9: Use Gradient Ribbon for Flow Intensity
The 9-layer gradient ribbon shows order flow intensity. Brighter, more opaque ribbon indicates stronger institutional activity. Gold/green ribbon indicates bullish flow. Indigo/pink ribbon indicates bearish flow.
Step 10: Avoid Liquidity Voids
Watch for "VOID" labels and dark background zones indicating liquidity voids. These areas have minimal institutional interest and often result in fast price movement or gaps. Avoid entering positions in void zones.
Step 11: Confirm with Smart Money Divergence
Check dashboard for divergence signals. Multi-oscillator divergence (2+ oscillators) indicates smart money positioning against the trend. Bullish divergence at lows suggests institutional accumulation. Bearish divergence at highs suggests institutional distribution.
Step 12: Use Tape Reading Metrics
Monitor the Tape row in the dashboard. "Agg Buy" indicates aggressive institutional buying. "Agg Sell" indicates aggressive institutional selling. "Passive" indicates patient absorption at current price levels.
Best Practices
Use on liquid instruments (major forex pairs, large-cap stocks, major crypto) for reliable signals
Institutional footprints work best at price extremes (near POC, outside value area, at support/resistance)
Combine with higher timeframe trend analysis - institutional activity against trend is lower probability
High confidence signals (>90%) have highest win rate but occur less frequently
Footprint clusters indicate institutional conviction - wait for 3+ footprints before acting
Iceberg orders provide strong support/resistance - use as entry/exit zones
Market maker withdrawal (wide spreads) often precedes significant moves - be cautious
Liquidity voids should be avoided for entries - price moves quickly through these zones
Toxic flow above 0.8 indicates extreme institutional urgency - strong directional signal
Absorption coefficient above 0.85 indicates very strong institutional positioning
POC proximity (<2% distance) provides high-probability reversal zones
Smart money divergence requires 2+ oscillator confirmation for reliability
Use gradient ribbon intensity to gauge institutional conviction - brighter = stronger
Dashboard metrics provide context - monitor multiple metrics simultaneously for best results
Combine absorption with toxicity for highest conviction signals
Indicator Limitations
Requires sufficient volume data - may not work well on illiquid instruments or off-market hours
Volume Profile calculation is computationally intensive - optimized to recalculate every 10 bars
Toxicity Index is a proxy for order flow - not actual Level 2 order book data
Absorption Coefficient assumes volume intensity indicates institutional activity - can produce false signals during news events
Market microstructure analysis (spread/depth) is estimated from OHLCV data - not actual order book depth
Iceberg detection requires repeated absorption at same price - may miss single large orders
Footprint clustering requires sufficient historical data - may not work well on new instruments
Smart money divergence adds lag - early signals may not have divergence confirmation yet
Confidence score is multi-factor - high confidence doesn't guarantee immediate price movement
Gradient ribbon visualization requires sufficient price movement to display properly
Dashboard metrics are real-time snapshots and can change rapidly during volatile periods
POC and Value Area calculations require sufficient lookback data - may be less reliable on very low timeframes
Liquidity void detection may produce false signals during consolidation periods
Tape reading metrics simulate order book behavior - not actual tape data
Technical Implementation
Built with Pine Script v6 using:
Order Flow Toxicity Index with aggressive vs passive flow classification
Optimized Volume Profile calculation with POC, VAH, VAL detection (recalculates every 10 bars for performance)
Absorption Coefficient algorithm combining volume intensity and price movement
Market Microstructure analysis with spread z-score and depth proxy calculations
Smart Money Divergence Engine using RSI, MFI, and Cumulative Volume Delta
Liquidity Void Detection with consecutive void bar tracking
Footprint Clustering system with dominant type classification
Tape Reading Metrics simulating Level 2 order book behavior
Iceberg Order Detection through repeated absorption pattern recognition
Multi-factor Confidence Score system (6 components, 0-100% scale)
9-layer gradient ribbon with progressive transparency and dynamic coloring
Institutional VWAP with dynamic color based on activity type
Comprehensive visualization system with 15+ chart overlay types
Real-time dashboard with 13+ institutional metrics
13 alert conditions for institutional events
Dynamic bar coloring based on institutional activity intensity
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive institutional order flow detection approach. While volume analysis and VWAP are established concepts, this indicator is justified because:
It combines 9 distinct institutional detection methods (Toxicity, Volume Profile, Absorption, Microstructure, Divergence, Void Detection, Clustering, Tape Reading, Iceberg Detection) into a unified system
The Order Flow Toxicity Index quantifies aggressive vs passive flow through candle position and volume weighting - a unique approach not found in standard volume indicators
Absorption Coefficient algorithm specifically quantifies institutional absorption by measuring volume intensity relative to price movement
Market Microstructure analysis estimates spread and depth from OHLCV data without requiring Level 2 order book access
Iceberg Order Detection identifies hidden institutional liquidity through repeated absorption pattern recognition
Footprint Clustering system tracks and classifies institutional footprints to identify accumulation/distribution zones
Multi-factor Confidence Score synthesizes 6 independent detection methods into a single 0-100% quality metric
9-layer gradient ribbon provides intuitive visualization of order flow intensity with dynamic coloring based on activity type
Comprehensive dashboard synthesizes 13+ metrics (Confidence, Toxicity, Absorption, POC Distance, Value Area, Spread, Depth, MM Activity, Imbalance, Cluster, Liquidity, Tape, Iceberg) into actionable intelligence
Integration of Volume Profile POC with absorption and toxicity creates unique confluence zones
Tape Reading Metrics simulate Level 2 order book behavior using only OHLCV data
Smart Money Divergence Engine combines RSI, MFI, and CVD for multi-oscillator confirmation
Each component contributes unique information: Toxicity shows aggressive flow, Volume Profile shows price acceptance, Absorption shows institutional positioning, Microstructure shows market maker behavior, Divergence shows smart money positioning, Void Detection shows areas to avoid, Clustering shows conviction, Tape Reading shows order urgency, and Iceberg Detection shows hidden liquidity. The indicator's value lies in presenting these complementary perspectives simultaneously with a unified confidence scoring system and intuitive visualization.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades
Indicator

Institutional Order Flow Shield [MarkitTick]💡 The Institutional Order Flow Shield is an advanced, overlay-based technical indicator designed to peer inside the standard price chart and extract granular order flow dynamics. By utilizing lower timeframe (LTF) intrabar data, this tool reconstructs buying and selling pressure, helping traders identify hidden accumulation, distribution, and manipulative market practices such as order spoofing and iceberg execution. It acts as a comprehensive shield, filtering market noise through volatility and trend alignment to deliver high-probability signals.
✨ Originality and Utility
Standard volume indicators often fail to distinguish between aggressive buying and aggressive selling within a single candle. This script solves that problem by drilling down into intrabar price action to approximate order flow delta.
● Key Differentiators
Intrabar Reconstruction: Rebuilds volume delta without requiring expensive tick data or footprint charts.
Manipulation Detection: Specifically engineered to detect "Spoofing" (pulling large limit orders to fake price direction) and "Icebergs" (large hidden orders executing in smaller clips).
Adaptive Decision Matrix: Does not just fire raw signals; it weights them using a confidence scoring system based on VWAP, EMA trends, and Relative Volume (RVOL).
🔬 Methodology and Concepts
The core engine of this indicator relies on several interconnected mathematical and logical frameworks to process market data.
● Order Flow Approximation
The script requests lower timeframe data (defaulting to 1-minute candles) and calculates where the close occurs relative to the high-low range of that LTF candle. It allocates volume to the "Buy" side or "Sell" side proportionally. Wick rejections are also factored in to adjust the final volume delta, reducing the impact of passive limit orders getting filled at extreme highs or lows.
● Spoof and Iceberg Logic
Spoof Detection: Triggered when a massive volume spike is followed immediately by a sharp volume drop and a price reversal, indicating that the liquidity was pulled (faked) rather than executed.
Iceberg Detection: Identified when volume surges past a smart threshold (based on a multiplier of the volume SMA) while price stalls, indicating a massive hidden limit order absorbing market aggression.
🎨 Visual Guide
The indicator provides a rich, non-intrusive visual experience on the main chart, utilizing color-coded bars, labels, and a comprehensive dashboard.
● Chart Elements
Bar Colors: Candles are painted bright green for confirmed bullish signals (confidence > 50%) and bright red for confirmed bearish signals.
ACM / DST Labels: Green "ACM" labels indicate accumulation (bullish order flow), while Red "DST" labels indicate distribution. Hovering over these labels reveals a tooltip with confidence score, VWAP alignment, and volume impact.
BPL / APL Labels: Orange labels denoting Bid Pulls and Ask Pulls (Spoofing events).
BWL / AWL Labels: Cyan labels highlighting Bid Walls and Ask Walls (Iceberg events).
WBD / WAK Labels: Faded cyan labels indicating massive Whale Bid or Ask entries based purely on relative volume spikes.
● The Sniper Dashboard
Located by default in the top right corner, this table provides a real-time summary.
Net Whale Flow: The cumulative delta of massive order events.
Decision Matrix: Displays the current overall bias (e.g., "STRONG BUY" or "WAIT/NEUTRAL").
Signal Confidence: A percentage score grading the strength of the current setup.
Filters: Real-time status of RVOL, VWAP Position, EMA Trend, and ATR Gates.
Event Counters: Tracks the total number of spoofing and iceberg anomalies detected during the session.
📖 How to Use
This indicator is best used as a confluence tool for day trading and scalping.
● Trade Execution Guidelines
Identify the Trend: Check the dashboard to ensure the EMA 50/200 trend aligns with your directional bias.
Wait for Manipulation: Look for Spoof (BPL/APL) or Iceberg (BWL/AWL) labels. A Bid Pull (Spoof) often precedes a move lower, while a Bid Wall (Iceberg) can act as solid support.
Confirm with Accumulation/Distribution: Enter a long trade when a green "ACM" label appears, confirming that aggressive buyers have stepped in. Ensure the dashboard's "Signal Conf." is high (above 60-70%).
Risk Management: Place stop losses behind identified Iceberg walls. If an Ask Wall (AWL) is broken by price, it often triggers a short squeeze, offering breakout opportunities.
⚙️ Inputs and Settings
The script offers deep customization through its settings menu, divided into functional groups.
● Order Flow Engine
Intrabar Timeframe (LTF): Determines the granularity of the internal volume calculation.
Flow Batch Length (bars): The rolling window used to sum up recent volume delta.
Flow Sensitivity Ratio: Adjusts how much larger the average buy size must be compared to the sell size to trigger an accumulation signal.
● Spoof & Iceberg Detection
Min Spoof Volume Diff: The minimum volume drop required to flag a pulled order.
Spoof Pull Threshold (%): The percentage drop required compared to the previous bar.
Iceberg Avg Multiplier: How many times larger than the average volume a bar must be to trigger an iceberg alert.
● Smart Filters
RVOL Filter: Requires the current bar's volume to be above a specific relative threshold, keeping you out of low-liquidity chop.
ATR Volatility Gate: Suppresses signals on extremely tight, flat candles based on a minimum ATR percentage.
VWAP / Trend Filters: Toggles the alignment checks that feed into the confidence scoring.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation of this indicator rests heavily on Market Microstructure Theory and Order Book Dynamics.
● Volume Delta Estimation Models
Because trading platforms often do not natively supply bid/ask tick data for all assets, the script utilizes an intrabar price-proportion heuristic. This aligns with academic models like the Lee-Ready algorithm, which infers trade direction based on price movement relative to previous prints. By applying this to LTF data and rolling it up, the script effectively calculates a weighted approximation of order flow toxicity (the imbalance of aggressive market orders).
● Liquidity Illusion and Spoofing
Spoofing is a recognized manipulative practice where liquidity is posted to the limit order book to create a false impression of supply or demand, only to be cancelled before execution. The script attempts to quantify this mathematically by monitoring sudden, severe variance in Relative Volume (RVOL) coupled with strict directional price reversals. When volume drops below the pullback threshold immediately following an injection phase, the algorithm flags the structural anomaly.
● Bayesian-Inspired Confidence Matrix
The Decision Matrix behaves similarly to a naive Bayesian classifier. It starts with a base event (e.g., an accumulation phase) and updates the probability (Confidence Score) of a successful follow-through by checking independent market state variables: Mean Reversion metrics (VWAP), Volatility (ATR), and Momentum (EMA crossover). This multidimensional filtering ensures that order flow anomalies are only traded when the broader statistical environment is favorable.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

Liquidity ThermometerThis is a universal indicator that assesses market liquidity based on five key market parameters: volume, volatility, candlestick range, body size, and price momentum.
The indicator does not use open interest data and is suitable for all markets, including spot, futures, and Forex.
This indicator normalizes each metric historically and creates a composite index between 0 and 1, where higher values correspond to a stable and calm market environment, and lower values indicate periods of increased risk and potential liquidity stress.
LT generates an integral liquidity index in the range based on five normalized components:
-nVol — normalized volume, reflecting trading density and activity.
-nATR — the volatility component (ATR), inverted, as high volatility is typically associated with declining liquidity.
-nRange — the normalized candlestick range, also inverted to assess the structural narrowness of the price movement.
-nBody — the normalized candlestick body size (|close − open|), inverted to assess the balance of supply and demand.
-nMove — the normalized value of the price impulse movement (|Δclose|), reflecting short-term price spikes.
Each metric is linearly normalized over a sliding window (200 bars) using the formula:
norm(x) = (x − min) / (max − min),
where at max = min, the value is fixed at 0.5 to ensure stability.
The ALT index is calculated as a weighted combination:
ALT = 0.35 nVol + 0.20 (1 − nATR) + 0.20 (1 − nRange) + 0.15 (1 − nBody) + 0.10 (1 − nMove)
The result is further smoothed using EMA(3) to reduce micronoise.
Red Zone (MLI < 0.25) — Risk, Thin Liquidity
When the indicator falls into the red zone, it means the market is extremely volatile:
Characteristics:
Low volume — small trades have a strong impact on the price.
High volatility — candlesticks rise or fall sharply.
Wide candlestick range — the market is "breathing heavily," easily breaking price extremes.
Impulsive movements — small market shocks lead to sharp spikes.
Thin liquidity — few orders in the order book, large orders "eat up" the market.
What this means for a trader:
🔥 High risk of spikes and false breakouts.
⚠ Possible series of liquidations on leverage.
❌ It is not recommended to enter long or short positions without a filter or protection.
✅ Can be used for short scalping strategies if you know the entry point, but very carefully.
Green Zone (MLI > 0.75) — High Liquidity, Safe Zone
When the indicator rises into the green zone, it means the market is stable and balanced:
Characteristics:
High volume — the market is deep, orders are executed without a strong impact on the price.
Low volatility — candlesticks are stable, no sharp spikes.
Narrow candlestick range — price moves calmly.
Weak impulse movements — no sharp surges.
Sufficient liquidity — the market can handle large orders.
What this means for a trader:
✅ Safe zone for opening positions.
🔄 Easier to set stop-loss and take-profit orders.
💡 You can trade both up and down, the risk of sharp movements is minimal.
⚡ Under these conditions, there is a lower risk of spikes and accidental liquidations.
It does not predict price movements or guarantee results. It is an analytical tool intended for additional research into market structure.
Indicator
