Wskaźnik Pine Script®
Multi-timeframe
Wskaźnik Pine Script®
Anchored VWAP ChannelAnchored VWAP Channel — Regime, Confluence & Reversals
What it is
This is a single overlay that builds a complete read of price around one Anchored VWAP. Instead of just drawing a VWAP line, it wraps the VWAP in a volatility channel and then layers the context a discretionary trader normally checks by eye — where price sits versus fair value, whether the move is trending or stretched, where high-volume and Fibonacci levels line up, and where the edges are getting rejected. Everything is derived from the same anchor and measured in the same volatility unit (one standard deviation, σ), so the pieces describe one structure rather than competing with each other.
It runs on any asset class and any timeframe. On instruments that carry real volume (stocks, futures, crypto, etc.) the VWAP, the channel, and the volume profile are fully volume-weighted; on feeds without real volume it falls back gracefully and flags the change in the table (see "Notes and limitations").
Why these components are combined (and how they work together)
This is intentionally a mashup, and the parts are chosen because they answer different questions about the same reference point:
• The Anchored VWAP is the fair-value anchor — the volume-weighted average price since a chosen pivot.
• The channel turns dispersion around that anchor into a measurable unit: the bands are the AVWAP ± k·σ, where σ is the volume-weighted standard deviation of price about the VWAP. This converts "how far is price from fair value" into a number (σ-distance) every other module can reuse.
• The regime read uses that σ-distance together with the VWAP slope and the band behaviour to label continuation vs reversal — so the same channel that draws the bands also tells you whether to trust a band tag or fade it.
• The volume profile (Point of Control + Value Area) is computed over the same anchored window, so the high-volume price and the value range are measured on exactly the data the VWAP is built from — not an arbitrary separate lookback.
• The Fibonacci grid is drawn on the active swing leg and is only emphasised where a level coincides with the VWAP, a band, or the POC. The channel and profile are what make a fib level meaningful here; on their own the fib levels would be just lines.
• The reversal signals fire on outer-band rejections, and the optional confluence filter suppresses them while the regime is strongly trending (when band tags tend to continue) — i.e. one module gates another.
In short: the channel produces a σ-distance, and the regime, profile, fib confluence, reversal logic, divergence and squeeze modules all consume that single shared measurement. That shared plumbing is the reason these are bundled into one script instead of run as six separate indicators.
What it plots
• Anchored VWAP centerline with a glow halo, colored by slope direction.
• Channel bands at ±1σ and ±2σ. The fill can be a "reversion heat" gradient (denser toward the outer band, red above the VWAP, green below) or a neutral glow, or off.
• Volume profile drawn as a translucent Value Area box (VAL→VAH) with a distinct POC line — kept visually and positionally separate from the fib lines so the two are never confused.
• Fibonacci grid (active-leg retracement, plus optional swing-to-swing), with confluence levels marked by a star and a brighter tone.
• Signals: trend-shift triangles on VWAP reclaim/loss; solid reversal labels on band rejections; diamonds and connecting lines for σ-distance divergence; a marker on volatility-squeeze release.
• Status table (single panel): regime, bias, σ-distance, AVWAP, POC, Value Area, squeeze state, divergence, a reversion stop/target/RR template, a data-health row, multi-timeframe regime agreement, and a built-in legend.
• Optional forward projection cone and an optional self-calibration panel that scores how past signals resolved.
Anchor modes
Rolling (fixed bar window), Swing Low, Swing High, or Dual (auto — anchors to the more recent significant pivot). Pivot detection uses bar-count lookbacks (8/13/21/34/55/89), so the entire tool self-scales to any timeframe.
How to use it
1. Read the table first: regime + σ-distance tell you whether price is trending or stretched, and how far from fair value it is.
2. Use the bands as context — near the centerline is fair value; the ±2σ edge is where reversion risk is highest (and the heat fill shades it).
3. Treat reversal labels as fade-the-stretch signals, strongest when the regime is not trending and when a divergence diamond agrees.
4. Use trend-shift triangles (VWAP reclaim/loss) for continuation context.
5. Use fib-confluence stars and the Value Area box / POC as the levels most likely to react.
6. Check multi-timeframe agreement in the table before acting.
7. Optionally turn on the calibration panel to see, on your own symbol and timeframe, how often each signal type has historically followed through.
What makes it original
• A single shared σ framework: bands, regime, divergence, reversals and risk template all read from one volume-weighted standard-deviation measurement around one anchor, rather than bolting unrelated indicators together.
• Reversion-heat channel fill that encodes reversion risk as color density.
• Confluence-filtered reversals — band rejections gated by regime/divergence.
• Volume profile rendered as a separated zone so it never blends into the fib levels.
• A transparent self-calibration panel that scores the script's own signals against a follow-through threshold (descriptive, not a backtest).
Key settings
• Calculation Source — works on any asset/market; default hlc3, switchable to close, hl2, ohlc4, etc.
• Anchor mode and pivot/rolling length.
• Inner/outer band multipliers and fill style.
• Signal sensitivity, session-open filter, reversal-confirmation strictness.
• Table position / text size / legend, and toggles for every module.
Notes and limitations
• Signals are evaluated on closed bars; the σ-distance divergence confirms a few bars after a pivot by design, so it prints late (this is normal for pivot-based divergence and is not repainting of confirmed history).
• Last-bar drawings (profile, fib, projection cone) are redrawn on each new bar and will shift forward — that is expected.
• Asset classes / volume: runs on any market and any timeframe. On instruments that carry real volume (stocks, futures, crypto, etc.) the Anchored VWAP, the volume-weighted σ channel, and the Volume Profile (POC / Value Area) are all fully volume-weighted as intended. On feeds with no real volume (e.g. spot forex, some indices / CFDs) the script still works but degrades gracefully: the VWAP becomes a simple anchored mean, the channel uses an unweighted standard deviation, and the profile becomes a time-at-price distribution. The Data row in the table flags this state as "no-vol / DEGRADED" so you always know which mode you are in.
• The multi-timeframe dashboard uses higher-timeframe requests; you can turn it off to reduce load.
• This is an analysis/visualization tool, not a strategy — it does not place orders and is not optimized or backtested for entries/exits.
Disclaimer
This script is provided for educational and informational purposes only and is not financial, investment, or trading advice. It does not predict future prices. Markets carry risk and you can lose money. Past behaviour of any signal (including the calibration panel) does not guarantee future results. Always do your own research and consider consulting a licensed financial professional before trading. You are solely responsible for your decisions and their outcomes.
Wskaźnik Pine Script®
CVD X-Ray
CVD X-Ray
See the Participation Behind the Move
Most indicators tell you what price is doing.
CVD X-Ray is designed to reveal who is participating behind the move.
Price can rally on weak participation.
Price can decline despite aggressive buying.
Price can appear strong while participation quietly deteriorates beneath the surface.
CVD X-Ray was built to expose these hidden shifts in market participation by combining cumulative volume delta pressure, momentum acceleration, participation normalization, and multi-timeframe alignment into a single visual framework.
Rather than focusing solely on market structure, CVD X-Ray focuses on participation pressure—the intensity and direction of buying and selling activity driving the current move.
What Makes CVD X-Ray Different?
Traditional volume indicators often struggle with context.
A large reading may appear important on one chart while being completely normal on another.
CVD X-Ray solves this by normalizing participation pressure and classifying it into intuitive strength categories:
Weak
Building
Moderate
Strong
Extreme
This allows traders to quickly distinguish between routine activity and meaningful participation events.
Pressure vs Trend
One of the most common mistakes traders make is confusing participation with trend.
A market can be trending lower while buyers suddenly begin participating aggressively.
Likewise, a market can be trending higher while participation quietly weakens beneath the surface.
CVD X-Ray intentionally measures participation pressure rather than market structure trend.
This distinction can help identify potential continuation opportunities, weakening moves, failed breakouts, and early signs of accumulation or distribution.
Strength and Rarity
Each reading is evaluated based on both participation strength and historical context.
The optional percentile ranking (PCT) provides additional insight into how unusual the current participation reading is relative to recent market behavior.
For example:
P80 = Stronger than 80% of recent readings
P95 = Stronger than 95% of recent readings
This helps traders quickly recognize when participation is becoming statistically significant.
Designed for Clarity
CVD X-Ray was built around a simple goal:
Reduce information overload while increasing informational value.
The interface uses a consistent strength scale, visual participation hierarchy, and clean multi-timeframe dashboard to deliver actionable context without cluttering the chart.
Whether you're analyzing breakouts, pullbacks, reversals, or trend continuation setups, CVD X-Ray provides a structured view of the participation driving price.
Because understanding what price is doing is useful.
Understanding who is participating behind the move is often more valuable.
Disclaimer
CVD X-Ray is an analytical tool designed to assist in evaluating market participation and participation pressure. It does not predict future price movements and should not be used as a standalone basis for trading decisions.
All trading involves risk, including the potential loss of capital. Past performance, historical participation readings, and indicator signals are not guarantees of future results.
This script is provided for educational and informational purposes only and does not constitute financial, investment, or trading advice. Users are solely responsible for their own risk management and trading decisions.
Wskaźnik Pine Script®
MTF CVD Synchrony | Rainbow MatrixGENERAL OVERVIEW
MTF CVD Synchrony is a multi-timeframe directional flow oscillator that condenses five independent CVD (Cumulative Volume Delta) readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line on a zero-centered 0-100 scale, surrounded by per-TF "ghost lines" that fade visually as they diverge from the consensus. The defining feature: 50 is true neutral. Above 50 means buyers are dominating; below 50 means sellers are dominating. The further from 50, the stronger the directional pressure. When the five timeframes align, the rainbow becomes a solid band; when they diverge, the disagreement becomes a visible density property of the indicator itself.
A background histogram visualizes the Master score's deviation from the neutral 50 line — green columns extend up when buyers dominate, red columns extend down when sellers dominate. A compact 7×9 MTF Legend Table surfaces every dimension simultaneously: per-TF resolutions, score values, trend direction, divergence flags, raw flow magnitude, and named directional State — with an antenna marker flagging the row whose timeframe matches your chart's native resolution.
Designed as the directional member of a three-indicator family. Apply all three side-by-side for a complete read: MTF RSI Synchrony shows where price sits in its momentum range; MTF Volume Delta Bar Synchrony shows whether the move has volume magnitude behind it; MTF CVD Synchrony shows who is actually winning — buyers or sellers. Same visual signature, same canonical Fibonacci ratios, same Legend Table layout — instant cross-indicator readability.
WHAT IS THE THEORY BEHIND THIS INDICATOR
Cumulative Volume Delta attempts to answer a question that price and volume alone cannot: in any given bar, were buyers or sellers more aggressive? Traditional volume tells you HOW MUCH traded, but not the DIRECTION of the pressure. A high-volume bar that closes flat tells a very different story from a high-volume bar that closes at its highs — yet raw volume scores them identically.
CVD approximates directional pressure by weighting each bar's volume by where price closed within its range. This indicator uses the Close Location Value (CLV) for that weighting:
clv = ((close − low) − (high − close)) / (high − low)
CLV ranges from +1 (close exactly at the high — maximum buying pressure) to −1 (close exactly at the low — maximum selling pressure), with 0 at the midpoint. Multiplying CLV by volume produces a signed directional contribution per bar: delta_raw = clv × volume. This is more nuanced than the binary tick rule (close > open = buy) used by most "delta" indicators — CLV captures HOW DECISIVELY price closed in its range, not just the sign.
The per-bar delta is then smoothed by EMA and normalized into a bounded 0-100 zero-centered score:
cvd_smooth = EMA(delta_raw, smoothing_length)
max_abs = highest(|cvd_smooth|, normalization_window)
score = 50 + (cvd_smooth / max_abs) × 50
The genius of the zero-centered approach: 50 always means balance, regardless of the asset's structural bias. A score of 75 means buyers are exerting 50% of the maximum recent pressure to the upside; a score of 25 means sellers are exerting 50% of maximum recent pressure to the downside. This is fundamentally different from a percentile rank (which would anchor 50 at the historical median, skewing with structural trends).
Five such scores — one per timeframe (default 5 / 15 / 60 / 240 / D) — are fused via canonical Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15, peak weight on the macro TF3/TF4 where institutional positioning consolidates) into the weighted Master Line.
FEATURES
🔹 Multi-Timeframe CVD Fusion Engine (zero-centered directional scale)
🔹 CVD Histogram (deviation from neutral 50 — green buy / red sell)
🔹 Adaptive Fibonacci Channel (Z-Breathing → Z-Alert → Z-Exhaustion → Black Swan)
🔹 Hybrid Black Swan Zones (static or dynamic — default dynamic)
🔹 Classic Price↔CVD Divergence Detection (per-TF + Master)
🔹 MTF Legend Table (7 columns × 9 rows, with Raw Flow + State, multilingual)
🔹 Multilingual Interface (EN / PT / ES / RU / ZH)
🔹 Multi-Timeframe CVD Fusion Engine
What It Does
Runs five independent CVD scores on Fibonacci-spaced timeframes and fuses them into a single weighted Master Line, with each per-TF reading plotted as a ghost line that fades by distance to the consensus.
Method
On each timeframe, f_cvd_full() computes CLV × volume per bar, smooths it via EMA, and normalizes against a rolling-max window to produce the zero-centered score. The five scores fuse via Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15). Both smoothing length and normalization window are independently configurable per timeframe.
Per-TF smoothing defaults (Wilder-anchored on TF3+TF4):
◇ TF1 (5m): 7 — scalping
◇ TF2 (15m): 10 — day-trading
◇ TF3 (60m): 14 — Wilder canonical
◇ TF4 (240m): 14 — Wilder canonical
◇ TF5 (D): 21 — swing/position
Per-TF normalization windows (each TF's natural horizon):
◇ TF1: 30 (≈2.5h on 5m)
◇ TF2: 50 (≈12.5h on 15m)
◇ TF3: 80 (≈3.3 days on 1h)
◇ TF4: 100 (≈16 days on 4h)
◇ TF5: 150 (≈5 months on Daily)
All request.security calls use lookahead=barmerge.lookahead_off for anti-repaint integrity.
Why It Matters
A 5-minute buy surge means little if the 4-hour and daily flows are decisively selling. The fusion engine reveals whether directional pressure is aligned across timescales (high conviction) or contradictory (a counter-trend bounce inside a larger trend). The ghost-line rainbow makes that alignment visible at a glance.
🔹 Adaptive Fibonacci Channel
What It Does
Six color-coded bands around the Master Line that adapt to its own recent volatility, using the brand's canonical Fibonacci ratios.
Method
Highest/lowest of the Master over a configurable lookback (default 50) are smoothed by EMA (default 10) to form the channel envelope. Bands sit at canonical Fibonacci proportions: Z-Breathing (1.50/1.85), Z-Alert (1.85σ anchor), Z-Exhaustion (2.75/1.85), Black Swan (3.85/1.85). All six band values are mathematically clamped to before rendering, keeping the rainbow inside the visible pane.
Why It Matters
Static thresholds can't adapt to regime changes. The Fibonacci channel calibrates the warning zones to the asset's current directional-flow volatility, so a "climax" on a calm pair and a "climax" on a volatile one both trigger at appropriate statistical extremes.
🔹 Hybrid Black Swan Zones
What It Does
Flags directional flow climax extremes — either at static 85/15 thresholds (BUY CLIMAX / SELL CLIMAX boundaries) or at the dynamic Fibonacci 3.85σ band.
Method
Dynamic Black Swan Mode is ON by default (Fibonacci 3.85σ proportion of the Master channel). Toggle OFF for static 85/15. Each zone renders as a glow line that brightens as the Master approaches. The static reference lines (15/50/85) are shown by default to anchor the zero-centered scale: 85 = purple (buy climax boundary), 50 = yellow (neutral), 15 = aqua (sell climax boundary).
Why It Matters
Directional flow climaxes mark exhaustion points — a BUY CLIMAX (score ≥ 85) means buyers have pushed to a recent extreme, often preceding a pause or reversal; a SELL CLIMAX (≤ 15) marks capitulation. The dynamic mode self-calibrates per asset and regime.
🔹 Classic Price↔CVD Divergence Detection
What It Does
Detects regular bear divergences (price higher high while CVD makes lower high — rally on weakening buy pressure) and bull divergences (price lower low while CVD makes higher low — selling exhausting). Runs on each timeframe AND on the Master line.
Method
Per-TF divergence runs inside request.security via pivot detection on the per-TF CVD score. Master divergence runs on the chart-TF directly, rendering a connecting line + label between pivots (red bear / green bull) on the pane. Per-TF results surface in the Legend Table's "Div" column.
Why It Matters
Price↔flow divergence is one of the most powerful applications of CVD. When price makes a new high but directional flow doesn't confirm, the rally is running on fading conviction — a classic distribution warning. Detecting this per-TF AND on the Master gives both early granular warnings and high-conviction confirmations.
🔹 MTF Legend Table
What It Does
A compact 7×9 table surfacing every dimension of the analysis at a glance.
Method
Rendered via table.new(force_overlay=false) on the pane. Layout:
◇ Row 0: title (spans all columns)
◇ Row 1: column headers — Indicator / Timeframe / Value / Trend / Div / Raw / State
◇ Rows 2-6: per-TF data
◇ Row 7: Master row ("🌈 Master (~XhYm)" with effective TF)
◇ Row 8: MTF Divergence status row
Per-TF cells show: ● TF label (+ antenna 📡 if chart-native), TF resolution, zero-centered score (zone-colored), trend arrow (±0.5 deadzone), divergence (🔺/🔻/—), Raw Flow (compact K/M/B signed magnitude, green if positive / red if negative), and State (directional name, zone-colored).
Why It Matters
The Raw Flow column complements the Value column: Value answers "how strong is the directional pressure?" (the normalized score), while Raw answers "how much actual volume is behind it?" (the absolute flow). A score of 75 with a small raw magnitude is weaker conviction than 75 with a huge raw magnitude. Together with State, the table tells a complete directional story per timeframe.
🔹 Multilingual Interface
What It Does
Translates all HUD labels, status messages, alert text, Legend Table headers, and directional State names to 5 languages: English, Português, Español, Русский, 中文.
Method
A single language dropdown selects the active language via Pine v6's ternary-chain pattern. Code, comments, and configuration tooltips remain in English by convention.
Why It Matters
The Rainbow Matrix family is built for traders worldwide. Multilingual UI removes friction for non-English-native users.
HOW TO USE
Reading the Pane
◇ Master near 50 with ghost lines tight: balanced flow, no directional edge (absorption / equilibrium).
◇ Master rising above 50: buyers gaining control. Above 62 = BUY PRESSURE; above 71 = STRONG BUY.
◇ Master falling below 50: sellers gaining control. Below 38 = SELL PRESSURE; below 29 = STRONG SELL.
◇ Master touches Black Swan High (≥85, purple glow): BUY CLIMAX — buyers at a recent extreme, watch for exhaustion.
◇ Master touches Black Swan Low (≤15, aqua glow): SELL CLIMAX — capitulation, watch for reversal.
◇ Histogram green/red columns: immediate bar-by-bar directional read around the 50 centerline.
Reading the Legend Table
The antenna marker (📡) flags your chart's native timeframe — start there, then scan up/down to see whether faster/slower TFs confirm or contradict the directional bias. Compare Value (pressure strength), Raw (actual flow magnitude), and State (named classification) for each row. The status row summarizes MTF alignment between TF1 and TF5.
Reading Divergences
Master bear divergence (price up + CVD down) = rally on fading buy conviction, distribution warning. Master bull divergence (price down + CVD up) = selling exhausting, potential bottom. Per-TF divergences in the Div column give early granular warnings.
Tactical Combinations
◇ Master BUY CLIMAX + bear divergence + multiple TFs diverging = strongest reversal-from-high signal.
◇ Master SELL CLIMAX + bull divergence = strongest reversal-from-low signal.
◇ Master near 50 + all TFs near 50 + tight ghosts = absorption / coiling, often precedes a directional break.
◇ Triple confluence (the full family): RSI overbought + Volume EXTREME magnitude + CVD STRONG SELL = distribution at the top. RSI oversold + Volume EXTREME + CVD STRONG BUY = accumulation at the bottom. These three indicators answering momentum + magnitude + direction simultaneously is the strongest read the Rainbow Matrix family offers.
INPUTS EXPLAINED
GLOBAL SETTINGS — System Language (EN/PT/ES/RU/ZH), table/label font sizes.
MULTI-TIMEFRAME — AI Auto-Sync TFs; TF1-TF5 manual resolutions (default 5/15/60/240/D); per-TF CVD Smoothing Length (7/10/14/14/21); per-TF CVD Normalization Window (30/50/80/100/150).
ENGINE — Dynamic Black Swan Mode (default ON); Dynamic Channel Lookback (50) and Smoothing (10); Divergence Pivot Lookback (5).
VISUALIZATION — TF1-TF5 colors + show toggles (all ghost lines OFF by default — only Master visible on install); Ghost Fade Sensitivity (3.5); Show Master Line / Rainbow Fills / Black Swan / Dynamic Channel; Show CVD Histogram; Show MTF Legend Table; Show Divergence Column; Show Raw Flow Column; Show State Column; Show Master Divergence Chart Line; Legend position; Show Divergence Event Markers; Show Static Reference Lines (15/50/85, ON by default).
ALERTS — Black Swan crossings (high/low); Strong MTF Divergence; Z-Exhaustion zone entries; Master Classic Divergence.
IMPORTANT NOTES
🔸 Pine Script v6 — uses request.security with lookahead=barmerge.lookahead_off. 16 total security calls (5 CVD score + 5 per-TF divergence + supporting channel calculations). Chart load may take a moment longer than a single-TF indicator.
🔸 CLV approximation, not order-flow tick data — Directional pressure is approximated via the Close Location Value (where price closed within each bar's range), NOT real bid/ask order flow. Pine Script v6 has no tick-by-tick data access in indicator scripts. CLV is a more nuanced approximation than the binary tick rule used by most free-tier "delta" indicators, but it remains an approximation. For true order-flow delta, use dedicated footprint/order-flow tools.
🔸 Zero-centered scale — Unlike the percentile-rank siblings (RSI, Volume Delta Bar), this indicator's 50 is a TRUE neutral (zero net directional flow), not a historical median. This is intentional — direction is inherently signed, so a fixed zero-point is more meaningful than a regime-relative median.
🔸 Normalization warmup — During the first normalization_window bars on each TF, the rolling-max anchor (max_abs) is built from a small sample, so early bars may show exaggerated swings until the window fills. Normal warmup behavior for any rolling-window indicator.
🔸 Repaint behavior — Historical bars use confirmed close data; the current real-time bar updates as ticks arrive. Pivot-based divergence requires confirmation bars before triggering (standard pivot divergence behavior).
🔸 Fibonacci ratios are canonical — The channel proportions (1.50/1.85/2.75/3.85) and fusion weights (0.15/0.20/0.25/0.25/0.15) match the Rainbow Matrix brand standard across all sibling indicators, preserving cross-indicator visual consistency.
🔸 License: MPL 2.0 — open source. Free to fork, modify, and republish under the same license terms.
UNIQUENESS
Three pillars differentiate this from other CVD indicators on TradingView:
1. Multi-timeframe CVD fusion with synchrony as a visual property. Most CVD tools run on a single timeframe. This indicator runs five, fuses them via Fibonacci weights, and expresses directional alignment as a rainbow density — solid when timeframes agree on direction, spread when they disagree. The cross-TF directional consensus becomes immediately readable.
2. True zero-centered scale with CLV weighting. The 50 midpoint is a mathematically meaningful neutral (zero net flow), not a regime-skewed median. And the directional weighting uses Close Location Value — capturing how decisively price closed within each bar's range — rather than the cruder binary tick rule. This combination produces a directional read that stays honest across structural trends.
3. Three complementary readings in one Legend Table, designed as a family. Value (pressure strength), Raw Flow (actual magnitude), and State (named classification) disambiguate a single timeframe's directional picture. And as the directional member of the Rainbow Matrix trio (alongside RSI for momentum and Volume Delta Bar for magnitude), it completes a three-dimensional read of any market: where price is, how big the move is, and who's winning.
Rainbow Matrix AI | Multi-timeframe institutional analysis tools for traders.
🌐 rainbowmatrix.ai
✉️ Contact: contact@rainbowmatrix.ai
Wskaźnik Pine Script®
Multi Trend FilterOverview
Multi Trend Filter shows the market's underlying trend with a single, clean line. It uses the Daily timeframe as the base, then layers 4H and 30m confirmation on top, coloring the trend in three intuitive states: green / yellow / red. No matter which chart timeframe you view it on (15m, 1h, 4h, etc.), it stays consistent on the Daily basis, and a two-pass smoothing keeps the line smooth on any chart.
WHAT THE COLORS MEAN
Green (UPTREND): Uptrend confirmed.
Yellow (TRANSITION): Trend is shifting — awaiting confirmation.
Red (DOWNTREND): Downtrend confirmed.
HOW IT WORKS — 3-STAGE MULTI-TIMEFRAME CONFIRMATION
Set the broad direction with higher timeframes first, then confirm the entry with the lower timeframe last.
Daily (Base / Reference line) — the line drawn on the chart; the anchor of the larger trend.
4H (Primary confirmation) — when both the close and the 4H flow align above/below the Daily line, the base direction is set.
30m (Final confirmation) — in that base direction, once the candle body closes across the 30m line, the color is finalized:
Close closes ABOVE the 30m line → Green
Close closes BELOW the 30m line → Red
Yellow (Transition) is the period before both stages confirm — the 4H hasn't committed yet, or it has but the close hasn't cleared the 30m line. Once green/red is confirmed, the color ignores minor noise while the base holds (latch), so it won't flicker.
HOW TO READ IT
Green: uptrend intact. Look for pullback entries.
Red: downtrend intact. Look for bounce exits / stay aside.
Yellow: direction unclear; safer to wait until it confirms green/red.
Yellow to Green = bullish shift. Yellow to Red = bearish shift.
KEY SETTINGS
Trend Line — First / Second Smoothing Length: line smoothness and responsiveness.
Display Smoothing — Smooth Line, Smooth Strength: keeps the line smooth on any timeframe (higher = smoother, slightly more lag).
Confirmation Lines — Show 30m Line (Signal) / Show 4H Line (Base): reveal the lines used for confirmation.
Style — up/down/transition colors, line width, fill and transparency, trend label.
TIPS
Use it as a trend direction and shift filter, not a standalone trade signal.
Reliability increases when the trend color agrees with your own setup (support/resistance, volume, etc.).
If the line looks choppy, raise Smooth Strength.
DISCLAIMER
This indicator is a reference tool to help judge trend direction. It does not guarantee trading profits. All trading decisions and responsibility rest solely with the user.
Wskaźnik Pine Script®
MTF Volume Delta Bar Synchrony | Rainbow MatrixGENERAL OVERVIEW
MTF Volume Delta Bar Synchrony is a multi-timeframe volume percentile fusion oscillator that condenses five independent volume readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line, surrounded by per-TF "ghost lines" that fade visually as they diverge from the consensus. When the five timeframes align, the rainbow becomes a solid band; when they spread apart, the disagreement becomes a visible density property of the indicator itself. A compact 7×9 MTF Legend Table surfaces every dimension simultaneously: per-TF volume percentile values, trend direction, divergence flags, Pulse magnitude ratio, and named State classification — with an antenna marker flagging the row whose timeframe matches your chart's native resolution.
Optional Delta Twin Bars project per-candle directional overlays directly onto the price chart via force_overlay=true, combining the oscillator pane and an order-flow approximation in a single indicator. A hybrid Black Swan zone detects volume climax (surge) and squeeze (drought) extremes — either as static 80/20 thresholds (classic) or as a dynamic Fibonacci-scaled channel that adapts to recent volatility. A classic price↔volume divergence engine detects Wyckoff-style "no demand" rallies and selling-climax bottoms on every timeframe and on the Master line.
Designed as a sibling to the MTF RSI Synchrony indicator. Apply both side-by-side for the complete momentum + volume picture: RSI shows where price sits in its momentum range; Volume Synchrony shows whether the move has institutional backing. Same visual signature, same canonical color zones, same Legend Table layout — instant cross-indicator readability.
WHAT IS THE THEORY BEHIND THIS INDICATOR
Most volume indicators on TradingView operate on a single timeframe — volume bars, OBV, CVD approximations — and report raw, unbounded volume values that vary wildly across timescales. A 5-minute volume bar of 50,000 contracts is meaningless without context: is that "high" for 5-minute bars on this asset, or "low"? Compared to what window? A trader watching a 5-minute chart cannot intuitively cross-reference whether that surge corresponds to anything notable on the 4-hour view.
This indicator solves the cross-timescale comparison problem by bounding every volume reading to a 0-100 percentile rank: the same scale, regardless of timeframe, regardless of asset. The percentile answers a single question: "where does this bar's volume sit in the distribution of recent volume on this timeframe?" — a number anyone can read at a glance.
Five percentile readings are then fused via canonical Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15 — peak weight on the macro TF3/TF4 where institutional consolidation tends to occur) into a single weighted Master Line. The Master adapts to a self-calibrating Fibonacci channel built from its own highest/lowest values over a configurable lookback, smoothed by EMA. Channel boundaries use the brand's canonical ratios: Z-Breathing (1.50σ), Z-Alert (1.85σ anchor), Z-Exhaustion (2.75σ), Black Swan (3.85σ) — same proportions as the RSI sibling for cross-indicator consistency.
The result is a volume picture that updates in real time, accounts for five timescales simultaneously, encodes "synchrony" itself as a visible rainbow density property, and triggers as an alertable signal when extremes converge.
FEATURES
🔹 Multi-Timeframe Volume Percentile Fusion Engine
🔹 Adaptive Fibonacci Channel (Z-Breathing → Z-Alert → Z-Exhaustion → Black Swan)
🔹 Hybrid Black Swan Zones (static 80/20 or dynamic Fibonacci-scaled)
🔹 Classic Price↔Volume Divergence Detection (per-TF + Master)
🔹 MTF Legend Table (7 columns × 9 rows, multilingual)
🔹 Volume Profile Reading (Pulse magnitude + State classification — 7-tier vocabulary)
🔹 Delta Twin Bars (per-candle chart overlay with 4 display modes + live intra-bar updates)
🔹 Multilingual Interface (EN / PT / ES / RU / ZH)
🔹 Multi-Timeframe Volume Percentile Fusion Engine
What It Does
Aggregates five independent volume percentile readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line. Each per-TF reading is plotted as a "ghost" line that fades by distance to the Master, so the rainbow becomes a visual representation of multi-timeframe consensus.
Method
Default timeframes are 5 / 15 / 60 / 240 / D (Trigger / Intraday / Macro 1 / Macro 2 / Base). On each timeframe, ta.percentrank(volume, length) produces a 0-100 percentile rank with lookahead=barmerge.lookahead_off for anti-repaint integrity. The five percentiles are fused via canonical Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15 — peak weight on TF3 and TF4 where institutional volume tends to consolidate). The Master itself is then clamped to for pane containment.
Per-TF length defaults are tuned to each timeframe's natural look-back window:
◇ TF1 (5m): 30 bars = 2.5 hours
◇ TF2 (15m): 50 bars = 12.5 hours
◇ TF3 (60m): 80 bars = 3.3 days
◇ TF4 (240m): 100 bars = 16 days
◇ TF5 (D): 150 bars = ~5 months
Set any per-TF override to 0 to inherit the global default (50). One-size-fits-all 50 bars across timeframes either lags on TF1 (16 hours of stale 5-minute history) or feels too reactive on TF5; the per-TF defaults match each horizon's natural cadence.
Why It Matters
Volume distribution is regime-dependent and timeframe-dependent. A single timeframe view can miss whether a 5-minute volume surge is the leading edge of a broader institutional move (visible on TF3/TF4) or a one-off scalper spike. The fusion engine surfaces alignment and disagreement instantly.
🔹 Adaptive Fibonacci Channel
What It Does
Renders six color-coded bands around the Master Line that adapt to its own recent volatility, using the brand's canonical Fibonacci ratios.
Method
Highest/lowest of the Master over lookback_dyn bars (default 50) are smoothed by EMA (default 10) to form dyn_up and dyn_dn. Channel bands are placed at canonical Fibonacci proportions:
◇ Z-Breathing: 1.50/1.85 ≈ 0.811 of half-channel
◇ Z-Alert: anchor at 1.85σ (the channel boundary itself)
◇ Z-Exhaustion: 2.75/1.85 ≈ 1.486
◇ Black Swan: 3.85/1.85 ≈ 2.081
All six band values are mathematically clamped to before rendering, so the rainbow stays inside the visible pane in volatile regimes (no auto-scale stretching). The algorithm itself is preserved bit-exact; only the rendered values are bounded.
Why It Matters
Static thresholds (e.g., 80/20) cannot adapt to regime changes. During a low-volatility consolidation, "70" might be a meaningful surge; during a news-driven trend, "70" might be the new baseline. The Fibonacci channel calibrates the warning levels to the asset's current regime, so the alerts stay informative regardless of market state.
🔹 Hybrid Black Swan Zones
What It Does
Flags volume climax (surge) and squeeze (drought) extremes either at static 80/20 thresholds (top 20% / bottom 20% historically) or at the dynamic Fibonacci 3.85σ band, depending on the operator's preference. Each zone is rendered as a glow line that brightens proportionally as the Master approaches.
Method
By default, Dynamic Black Swan Mode is ON for this indicator (matching the volume distribution's wider range vs canonical RSI). The Black Swan high/low values become osc_up4 / osc_dn4 — the Fibonacci 3.85σ proportion of the Master's channel. Toggle the mode OFF to revert to static 80/20 (top/bottom 20% volume thresholds — classic).
The proximity glow uses the canonical f_calc_glow pattern: transparency = 95 - (1 - dist/range) × 75, where range is the half-channel width. At zero distance, transparency = 20 (solid); at full range distance, transparency = 95 (invisible).
Why It Matters
Black Swan events on volume mark institutional climax moments — news breakouts, capitulation, distribution. The dynamic mode lets the indicator self-calibrate per asset and per regime, so a "climax" on a calm Forex pair and a "climax" on a meme stock both trigger at the appropriate statistical extremes rather than at an arbitrary 80% line.
🔹 Classic Price↔Volume Divergence Detection
What It Does
Detects regular bear divergences (price makes higher high while volume percentile pivot makes lower high — Wyckoff "no demand" rally) and regular bull divergences (price makes lower low while volume percentile pivot makes higher low — selling climax / capitulation). Runs on every individual timeframe AND on the Master line directly.
Method
For each TF, f_classic_divergence_vol(length, lookback) runs inside request.security: it detects pivot highs/lows on the per-TF volume percentile via ta.pivothigh / ta.pivotlow, captures pivot values using ta.valuewhen, and compares the current pivot vs the previous pivot. Default pivot lookback is 5 bars (matches the community standard).
Master divergence runs on the chart-TF directly (no request.security), so it always reflects the current chart resolution's pivot structure. When detected, it renders a connecting line + label between the two pivots on the indicator pane (red for bear, green for bull) and triggers the alert_divergence_native alert if enabled.
Per-TF divergence surfaces in the Legend Table's "Div" column: 🔻 for bear, 🔺 for bull, — for none. Multiple timeframes showing the same divergence direction = stronger conviction signal.
Why It Matters
Divergences between price and volume have been a cornerstone of Wyckoff/Volume Spread Analysis for decades. Most TradingView divergence indicators run on a single timeframe — by detecting per-TF AND Master simultaneously, this indicator surfaces both fast warnings (TF1 divergence) and high-conviction confirmations (Master + multiple TFs aligning).
🔹 MTF Legend Table
What It Does
Compact 7×9 table positioned in a configurable chart corner. Surfaces every dimension of the analysis at a single glance: per-TF resolutions, volume percentile values, trend direction, divergence status, Pulse magnitude, named State classification, plus a Master row and a status row.
Method
The table is rendered via table.new(force_overlay=false) on the indicator pane (kept off the price chart for mobile readability). Per-TF cells use:
◇ Col 0: ● TF label (matches ghost line color) + 📡 antenna marker if this TF == chart's native resolution
◇ Col 1: TF resolution string ("5", "15", "60", "240", "D"...)
◇ Col 2: Volume percentile value (color-coded by zone via the thermal matrix)
◇ Col 3: Trend arrow ▲ rising / ▼ falling / ▬ flat (±0.5 percentile point deadzone to avoid flicker)
◇ Col 4: Div indicator 🔺 bull / 🔻 bear / — none
◇ Col 5: Pulse magnitude ratio (color-coded by intensity tier)
◇ Col 6: State name (multilingual EXTREME / HIGH / ELEVATED / NORMAL / LOW / COMPRESSED / SQUEEZE)
The Master row (row 7) merges cols 0-1 into "🌈 Master (~XhYm)" — the "~XhYm" suffix is the geometric weighted mean of the 5 TF resolutions (same weights as the Master volume fusion), giving you the "effective timeframe" the Master is reading. The status row (row 8) merges cols 0-6 and shows the MTF Divergence summary: Aligned / Strong Top / Strong Bottom / Moderate Top / Moderate Bottom — with background color matching the severity.
All header strings, status messages, and state names support 5 languages via the System Language input (English / Português / Español / Русский / 中文).
Why It Matters
The Legend Table compresses what would otherwise require 5 separate chart panels into a single ~150-pixel-wide compact widget. The antenna marker is especially useful on mobile: it tells you instantly which row is "your" timeframe, so you can scan up/down to see whether faster/slower TFs confirm or contradict.
🔹 Volume Profile Reading — Pulse Magnitude + State Classification
What It Does
Two complementary readings that answer different questions about volume — both surfaced as dedicated columns in the Legend Table.
Method — Pulse Column
Pulse is the ratio volume / SMA(volume, length) per TF. 1.0× = volume at the baseline; below = drought; above = elevated. Color-coded by intensity tier:
◇ < 0.5× → aqua (drought extreme)
◇ 0.5-0.8× → teal (below baseline)
◇ 0.8-1.3× → gray (typical)
◇ 1.3-2.0× → yellow (elevated)
◇ 2.0-3.5× → orange (high activity)
◇ 3.5-6.0× → red (surge)
◇ ≥ 6.0× → purple (climax extreme)
Pulse values cap display at "9.9x+" to avoid overflow in narrow cells.
Method — State Column
State classifies the percentile rank into 7 named tiers using a multilingual dictionary:
◇ ≥ 85 → EXTREME (purple zone — top 15% historically)
◇ 71-85 → HIGH (red — top 30%)
◇ 62-71 → ELEVATED (orange)
◇ 38-62 → NORMAL (yellow / green — middle 24%)
◇ 29-38 → LOW (teal)
◇ 15-29 → COMPRESSED (blue)
◇ ≤ 15 → SQUEEZE (aqua — bottom 15%)
Why It Matters
Pulse and State answer different questions about the same volume reading:
◇ Value (percentile column 2): "Where in the historical distribution?" — a ranking answer.
◇ Pulse (column 5): "How intense vs recent baseline?" — a magnitude answer.
◇ State (column 6): "What's the human-readable label?" — a vocabulary answer.
These three columns together tell a complete story. A bar can be at Percentile 60 (NORMAL state) with Pulse = 3.5x (red surge) — meaning: "this bar's volume isn't historically rare, but it's a massive jump versus what's been happening recently." That's a different signal than Percentile 95 / Pulse = 1.0x (EXTREME state but typical magnitude) — meaning: "this is a rare historical bar, but the magnitude is normal relative to recent activity." The columns disambiguate.
🔹 Delta Twin Bars (Chart Overlay)
What It Does
Renders per-candle directional bars on the price chart (via force_overlay=true) whose dimensions encode the selected volume score and whose color encodes buy/sell pressure approximation. Bridges the gap between this script's oscillator pane and the price action itself.
Method
For each candle, the bar size = candle_range × (score / 100) × user_multiplier. The score source is configurable (Master or any TF1-TF5; default TF1 Trigger for the most responsive read).
Four display modes:
◇ Fixed High: bar always projects above the candle high (regardless of direction)
◇ Fixed Low: bar always projects below the candle low
◇ Dynamic: buy candles get bar above high, sell candles get bar below low (intuitive directional reading)
◇ Dynamic Inverted (default): buy candles get bar BELOW low, sell candles get bar ABOVE high — an order book metaphor where buy pressure builds support and sell pressure presses resistance
Bar color follows the user-configured buy/sell colors (green / red by default — matching the OHLC tick rule: close > open = buy bias, close < open = sell bias). An optional toggle ("Use Master Line Color") overrides this with the Master zone color via the thermal matrix — giving rainbow-colored bars that match the pane oscillator.
Bar width is pixel-controlled (1-8, default 8) via line.new with the user-selected linewidth — visually independent of chart zoom, distinguishable from candle wicks at any chart density.
Two update modes:
◇ Live (default): the current bar's twin bar updates on every tick — score, direction, and color reflect real-time data. When the bar closes, the live line is "frozen" into the confirmed pool. One additional persistent line is used (zero pool overhead).
◇ Confirmed-only: twin bar appears only when the candle closes (useful for backtesting comparisons where intra-bar flicker is unwanted).
The last 500 bars are rendered (Pine v6 line pool limit) with rolling FIFO management — older candles fall out of the pool and lose their twin bar, but the most recent 500 stay live.
🚨 Honest tick-rule disclosure
The buy/sell direction encoding uses the OHLC tick rule — close > open = buy bias, close < open = sell bias. This is NOT order-flow tick-data delta. Pine Script v6 has no tick-by-tick data access in indicator scripts on the free tier. The OHLC approximation is what virtually every "delta" indicator on TradingView free uses; this script discloses it transparently rather than claiming real order flow.
For most use cases (visual confirmation, trend bias, magnitude readings) the OHLC approximation captures the essential information. Traders who need true bid/ask delta should look at paid Order Flow tools or Sierra Chart / Bookmap.
Why It Matters
The Delta Twin Bars combine two analytical layers in a single indicator: the oscillator pane (Master fusion + ghost lines + Legend Table) and the chart overlay (per-candle directional reference). Most TradingView indicators force users to choose between oscillator-only or overlay-only paradigms; this script delivers both via force_overlay=true on selectively-rendered lines, preserving full pane functionality while adding a quick visual reference directly on the price candles.
🔹 Multilingual Interface
What It Does
Translates all HUD labels, status messages, alert text, state classifications, and Legend Table headers to 5 languages: English (default), Português, Español, Русский, 中文 (Chinese). 33 multilingual keys are maintained across all 5 languages.
Method
A single language dropdown input (in the GLOBAL SETTINGS group) selects the active language. The script uses Pine v6's _l == "PT" ? ... : _l == "ES" ? ... ternary chain pattern for each translated string, evaluated once at startup. Configuration tooltips, variable names, and code comments remain in English by convention — this script is designed to be readable to developers globally.
Why It Matters
Trading is a global activity. The Rainbow Matrix product family is designed for traders worldwide; multilingual UI removes a friction point for non-English-native users without adding development overhead.
HOW TO USE
Reading the Rainbow (Pane Oscillator)
◇ Master between 30 and 70 with all 5 ghost lines solid: typical volume profile, no anomaly to flag.
◇ Master entering Z-Alert (orange / teal bands): notable volume deviation — watch for follow-through confirmation across timeframes.
◇ Master in Z-Exhaustion (red high / blue low): elevated probability of climax or drought completing.
◇ Master touches Black Swan High (purple glow): volume climax event — statistically rare top-of-distribution moment, often coincides with news catalysts, breakouts, or capitulation.
◇ Master touches Black Swan Low (aqua glow): volume drought / squeeze — extreme compression, often precedes breakouts when paired with price consolidation.
Reading the Legend Table
The antenna marker (📡) flags your chart's native timeframe. Start your read there, then scan up/down the table to see whether faster/slower TFs confirm or contradict the current volume bias. Look at the relationship between Value (where in distribution), Pulse (how intense vs baseline), and State (named tier) for each row — divergences between these three readings within a single TF are early warnings.
The status row at the bottom summarizes MTF divergence: Aligned (TFs in agreement, default), Strong Top (TF1 ≥ 70 vs TF5 ≤ 30 — fast surge with slow drought), Strong Bottom (TF1 ≤ 30 vs TF5 ≥ 70 — fast quiet with slow surge), or Moderate variants of either.
Reading the Delta Twin Bars (Chart Overlay)
Tall bars = high volume score for that candle's TF source. With Dynamic Inverted mode (default), bars projecting BELOW buy candles signal "support building"; bars projecting ABOVE sell candles signal "resistance pressing" — an order book metaphor. Switch to Dynamic mode for a more intuitive directional read (buy bars project up, sell bars hang down). Use Fixed High/Low for cleaner price action when delta-only context is needed.
Reading Divergences
Master divergence (red line + 🔻 label on the pane) = price made a higher high while Master volume percentile made a lower high — Wyckoff "no demand" rally, often precedes reversal. Master bull divergence (green + 🔺) = price made a lower low while Master volume made a higher low — selling climax, often precedes bottom.
Per-TF divergences in the Legend Table's Div column give early granular warning: a TF1 divergence might fire 5-10 candles before the Master confirms. Multiple TFs aligning on the same divergence direction = high-conviction signal.
Tactical Combinations
◇ Master Black Swan High + Strong Top divergence + Bear Master divergence simultaneously = strongest reversal signal from highs.
◇ Master Black Swan Low + Strong Bottom divergence + Bull Master divergence = strongest reversal signal from lows.
◇ Master SQUEEZE state + multiple TFs SQUEEZE state + Pulse < 0.5x = pre-breakout compression — often precedes expansion events.
◇ Pulse spikes (red / purple tier) preceding percentile shifts = often mark turning points before the percentile catches up.
◇ Pair with MTF RSI Synchrony: Aligned RSI + Aligned Volume = high-conviction setup. Bear RSI div + Bear Volume div on Master simultaneously = strongest reversal signal.
INPUTS EXPLAINED
GLOBAL SETTINGS
◇ System Language (EN / PT / ES / RU / ZH) — affects HUD and alerts only; code stays in English.
◇ Table / Labels Font Size — Tiny / Small (default) / Normal / Large.
MULTI-TIMEFRAME
◇ AI Auto-Sync TFs — when ON, auto-adjusts the 5 TFs based on chart resolution.
◇ TF1-TF5 — manual TF override (defaults: 5/15/60/240/D).
◇ Default Volume Percentile Length — global default (default 50).
◇ TF1-TF5 Length Overrides — per-TF overrides; defaults 30/50/80/100/150; set to 0 to inherit global.
ENGINE
◇ Dynamic Black Swan Mode — ON by default (Fibonacci 3.85σ adaptive). OFF = static 80/20.
◇ Dynamic Channel Lookback (default 50) and Smoothing (default 10).
◇ Divergence Pivot Lookback — default 5 (community standard).
VISUALIZATION
◇ TF1-TF5 Color + Show toggles — TF1 and TF5 visible by default; TF2/3/4 hidden (opt-in).
◇ Ghost Fade Sensitivity — default 3.5 (lines invisible at ~20 percentile points from Master).
◇ Show Master Line / Show Rainbow Fills / Show Black Swan / Show Dynamic Channel — all default ON.
◇ Show MTF Legend Table — default ON.
◇ Show Divergence Column / Pulse Column — both default ON.
◇ Show Master Divergence Chart Line — default ON.
◇ Legend Table Position — Top/Bottom × Left/Right (default Bottom Right).
◇ Show Divergence Event Markers — default OFF (reduces clutter; toggle ON to display triangles).
◇ Show Static Reference Lines — default OFF (cleaner pane on install; toggle ON for 20 / 50 / 80 guides).
ALERTS
◇ Alert on Black Swan crossings (high / low) — default ON.
◇ Alert on Strong MTF Divergence — default ON.
◇ Alert on Z-Exhaustion zone entries — default OFF (opt-in).
◇ Alert on Master Classic Divergence — default ON.
DELTA TWIN BARS
◇ Show Delta Twin Bars — default ON.
◇ Score Source — Master / TF1 (default) / TF2 / TF3 / TF4 / TF5.
◇ Display Mode — Fixed High / Fixed Low / Dynamic / Dynamic Inverted (default).
◇ Buy / Sell Colors + Transparency + Size Multiplier — fully customizable.
◇ Use Master Line Color (override) — default OFF; toggle ON for rainbow-colored bars.
◇ Bar Width (pixels) — 1-8, default 8 (bold, high-visibility).
◇ Lookback (bars) — default 500 (Pine v6 pool maximum).
◇ Live Bar (intra-bar update) — default ON; toggle OFF for confirmed-only rendering.
IMPORTANT NOTES
🔸 Pine Script v6 — uses request.security with lookahead=barmerge.lookahead_off for anti-repaint integrity. The 5 per-TF volume fetches + 5 per-TF Pulse fetches + 5 per-TF divergence fetches + 6 other security calls = 21 total request.security calls; within TradingView's free-tier limits but noteworthy if combining with other heavy multi-TF indicators on the same chart.
🔸 Repaint behavior — historical bars use confirmed close data; the current real-time bar updates as ticks arrive (especially with Live Delta Bars enabled). The pivot-based divergence detection requires div_lookback confirmed bars before triggering — so divergence labels appear on the pivot bar in retrospect, not as live signals. This is standard pivot divergence behavior across all TradingView divergence indicators.
🔸 Tick rule approximation — Delta Twin Bars use the OHLC tick rule (close > open = buy bias) as a direction encoder. This is NOT real order-flow tick data. Pine Script v6 has no tick data access in indicator scripts. Same approximation is used by virtually every "delta" indicator on the TradingView free tier; this script discloses it transparently. For real bid/ask delta, use paid order flow tools.
🔸 Pine v6 line pool limit — Delta Twin Bars are bounded to 500 lines (Pine v6 hard limit). Older candles fall out of the rolling FIFO and lose their twin bar — this is a Pine engine constraint, not a bug. The current bar's live line uses ONE persistent slot reused across bars (no additional pool consumption).
🔸 Fibonacci ratios are canonical — the channel proportions (1.50 / 1.85 / 2.75 / 3.85) match the Rainbow Matrix brand standard across all sibling indicators. They are derived from the brand's design system and are not user-configurable — preserving cross-indicator visual consistency.
🔸 Master effective TF — the "~XhYm" label in the Master row is the geometric weighted mean of the 5 TF resolutions (same weights as the Master fusion: 0.15/0.20/0.25/0.25/0.15). With defaults 5/15/60/240/D, the effective TF is approximately 71 minutes (~1h11m). This tells you the "average horizon" the Master is reading.
🔸 License: MPL 2.0 (Mozilla Public License 2.0) — open source. Free to fork, modify, and republish under the same license terms.
UNIQUENESS
Three pillars differentiate this from the dozens of volume indicators already on TradingView:
1. Multi-timeframe percentile fusion with synchrony as a visual property. Most volume tools operate on a single timeframe with raw unbounded readings. This indicator bounds every reading to a 0-100 percentile scale, fuses five timeframes via Fibonacci-proportioned weights, and expresses synchrony itself as a "rainbow density" — solid when aligned, spread-out when diverging. The disagreement between fast and slow timeframes becomes immediately readable.
2. Three complementary volume readings in one Legend Table. Value (percentile rank), Pulse (magnitude ratio), and State (named tier) answer three different questions about the same volume reading. Most indicators give you one number; this one disambiguates "rare historical event" from "extreme recent magnitude" from "elevated relative position." The combination catches signals that single-metric views miss.
3. Combined oscillator + chart overlay in a single script. Delta Twin Bars project the per-candle volume score and tick-rule direction directly onto the price chart via force_overlay=true, while the full pane oscillator (Master fusion, ghost lines, Legend Table, divergence engine, dynamic channel) continues to operate independently. Most TradingView indicators force you to choose between oscillator-only or overlay-only paradigms; this script gives you both, with honest disclosure about the OHLC tick rule approximation.
Rainbow Matrix AI | Multi-timeframe institutional analysis tools for traders.
🌐 rainbowmatrix.ai
✉️ Contact: contact@rainbowmatrix.ai
Wskaźnik Pine Script®
MTF RSI Synchrony | Rainbow MatrixGENERAL OVERVIEW
The MTF RSI Synchrony is a multi-timeframe RSI fusion oscillator that aggregates five independent RSI readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line. Each per-timeframe RSI is also plotted as a "ghost line" that fades by distance to the Master: when the five timeframes align, the rainbow renders solid; when they diverge, the ghost lines spread visibly across the pane, making synchrony itself a visible density property rather than a number to compute.
The main goal of this indicator is to give traders a single integrated read of RSI across multiple horizons — without flipping between charts, mentally averaging values, or guessing which timeframe's RSI matters at the current decision point. Every line, color, and divergence event on the pane was derived from real RSI calculations on each native timeframe, not approximated from the current chart's resolution.
It computes the Master Line from five timeframes via Fibonacci-proportioned weights (peak weight on the macro middle TFs), classifies the result through an adaptive Fibonacci channel that builds Z-Breathing / Z-Alert / Z-Exhaustion / Black Swan zones around the Master, and runs a classic price↔RSI divergence engine on each of the 5 TFs plus the Master line independently. A 5-column MTF Legend Table surfaces every TF's state at a glance, with an antenna marker (📡) flagging the row whose timeframe matches the chart's native resolution.
This indicator was developed for traders who already understand RSI and divergence concepts and want to see them across multiple timeframes in a single visual, with automatic synchrony detection and an integrated classic divergence layer.
WHAT IS THE THEORY BEHIND THIS INDICATOR?
Most RSI implementations on TradingView operate on a single timeframe. They show you a value between 0 and 100 for the current chart and leave the multi-timeframe assessment to manual work — flipping between charts, sketching trendlines, or stacking multiple instances of the indicator on different intervals. This treats each timeframe as an isolated decision space.
The problem: institutional momentum is not isolated to one timeframe. The participants operating on the daily horizon see different RSI conditions than those operating on the weekly or 4-hour horizon. When the 15-minute RSI flips above 70 but the daily RSI is still neutral, the overbought signal is local — likely a counter-trend bounce. When the 15-minute RSI flips above 70 and the daily RSI also approaches the upper zone, the overbought signal is structurally agreed across horizons — far more likely to mark a multi-horizon exhaustion.
This indicator addresses that by extracting RSI from five user-configured timeframes simultaneously via request.security, fusing them via canonical Fibonacci weights (peak weight on the macro middle TFs), and rendering both the integrated Master signal and each contributing TF's individual reading on the same pane. The math of the per-TF extraction is standard RSI on the native bars — what makes it useful is doing it across five timeframes at once, weighting them by structural significance, and surfacing both the alignment and the per-TF divergences in a single visual.
The classic divergence layer addresses a parallel problem: textbook regular divergence (price↔RSI on the same timeframe) is a well-known reversal cue, but traders typically watch it on one timeframe at a time. By running pivot-based divergence detection independently on each of the 5 TFs and on the Master line, the indicator surfaces local divergences (on fast TFs — often noise) versus structural divergences (on slow TFs — often precede major reversals) in the same table view, with the Master line acting as the integrated read drawn directly on the chart.
MTF RSI SYNCHRONY FEATURES
The indicator includes 7 main features:
◇ Multi-Timeframe RSI Fusion Engine
◇ Adaptive Fibonacci Channel (Master Volatility Envelope)
◇ Hybrid Black Swan Zone (static or dynamic)
◇ Classic Divergence Detection Engine (per-TF + Master)
◇ MTF Legend Table with antenna marker
◇ Per-Timeframe RSI Length Customization
◇ Multilingual interface (5 languages) and full visual customization
MULTI-TIMEFRAME RSI FUSION ENGINE
🔹 What It Does
The core of the indicator. For each of the five configured timeframes, an independent RSI reading is extracted at its native resolution. The five readings are then fused into a single Master Line via canonical Fibonacci-proportioned weights.
🔹 Method
The extraction runs via request.security with lookahead=barmerge.lookahead_off to prevent repainting. Per-timeframe RSI uses Wilder's standard formulation. The Master is computed as a weighted average with the following Fibonacci weights:
◇ TF1 (Trigger, default 5m): 0.15
◇ TF2 (Intraday, default 15m): 0.20
◇ TF3 (Macro 1, default 60m): 0.25 (peak weight)
◇ TF4 (Macro 2, default 240m): 0.25 (peak weight)
◇ TF5 (Base, default Daily): 0.15
The peak weight sits on the macro middle TFs (TF3 + TF4), where institutional decisions consolidate. The Master is clamped to the 0–100 RSI range.
🔹 Ghost Line Rendering
Each per-timeframe RSI is plotted as a ghost line with transparency inversely proportional to its absolute distance from the Master. The fade sensitivity is configurable (default 3.5): at distance 0 the line is solid (transparency 20), at ~20 RSI points away it becomes effectively invisible. Synchrony emerges as a visible density property — when the five lines collapse toward the Master, the rainbow is solid; when they spread, the pane fills with translucent ghosts.
ADAPTIVE FIBONACCI CHANNEL
🔹 What It Does
The Master Line is wrapped in an adaptive volatility channel built from its own highest/lowest over a configurable lookback (default 50), EMA-smoothed (default 10). From the channel envelope, four Fibonacci-proportioned zones are derived above and below the channel midpoint:
◇ Z-Breathing (1.50σ proportion) — yellow (high) / green (low)
◇ Z-Alert (1.85σ anchor) — orange (high) / teal (low)
◇ Z-Exhaustion (2.75σ proportion) — red (high) / blue (low)
◇ Black Swan (3.85σ proportion) — purple (high) / aqua (low)
🔹 Why It Matters
The 30/50/70 lines of classic RSI are static — they don't adapt to the volatility regime of the current instrument or timeframe. The Fibonacci channel does. In a low-volatility regime, the Z-Exhaustion zone tightens and the script flags exhaustion at lower thresholds; in a high-volatility regime, the channel widens and only genuine outliers reach the extreme zones. The Master's position within the channel — color-coded continuously — is a regime-aware read on momentum saturation that the fixed 30/70 lines cannot provide.
HYBRID BLACK SWAN ZONE
🔹 What It Does
The Black Swan threshold operates in hybrid mode:
◇ OFF (default): classic 80/20 RSI extremes — the conventional Wilder oversold/overbought boundaries.
◇ ON: dynamic Fibonacci 3.85σ proportion of the Master channel — adapts to current volatility.
🔹 Method
When dynamic mode is enabled, the Black Swan High becomes osc_up4 = dyn_mid + (dist_up × 3.85/1.85), and the Low becomes dyn_mid − (dist_dn × 3.85/1.85). Both are clamped to . The threshold breathes with the channel — wider in volatile regimes, tighter in calm ones.
🔹 Visual Design
Black Swan zones render as a line + proximity-based glow only — NO fill is drawn underneath, by design. This is a hard rule of the indicator's visual grammar: every other zone (Breathing, Alert, Exhaustion) has a fill; Black Swan is line + glow only, making the extreme zone visually distinct from the gradient zones below it.
CLASSIC DIVERGENCE DETECTION ENGINE
🔹 What It Does
Regular divergence (price↔RSI on the same timeframe) is detected independently on each of the 5 timeframes and on the Master line:
◇ Bear divergence (top): price made higher high + RSI made lower high — momentum failing to confirm the new price peak; exhaustion warning.
◇ Bull divergence (bottom): price made lower low + RSI made higher low — momentum failing to confirm the new price trough; accumulation signal.
🔹 Method
Pivot detection runs via ta.pivothigh and ta.pivotlow with a configurable lookback (default 5 bars before and after). For each timeframe, the previous pivot and current pivot are compared on both price and RSI. A divergence is flagged when price and RSI move in opposite directions across the two pivots, gated by na guards to handle cold-start conditions.
🔹 Two Layers of Output
The detection produces two complementary outputs:
◇ Per-TF divergence flags are rendered in the Legend Table 'Div' column (🔺 bull / 🔻 bear / — none, color-coded). This gives granular per-horizon insight: which exact timeframe is showing divergence right now.
◇ Master divergence — the integrated MTF signal — is additionally drawn on the indicator pane as a line connecting the two pivots, with a "🔺 Bull Div Master" or "🔻 Bear Div Master" label at the second pivot. An alert is available (toggleable, ON by default).
🔹 Why Two Layers
Per-TF divergences answer "where is the divergence forming?" — fast TFs (TF1, TF2) often catch local noise; slow TFs (TF4, TF5) catch structurally significant turns. Master divergence answers "is the integrated MTF view showing exhaustion?" — Master fuses all five TFs into one signal weighted by significance, so its divergence is the consolidated read. The strongest setups occur when both layers agree: Master divergence drawn on the chart + multiple Legend Table 'Div' cells lighting up in the same direction.
MTF LEGEND TABLE
🔹 What It Shows
A compact 5-column table renders inside the indicator pane (force_overlay=false for mobile readability), with 8 rows:
◇ Row 0: title header (multilingual)
◇ Rows 1–5: per-timeframe data — color-coded RSI value, timeframe resolution, trend arrow (▲ rising / ▼ falling / ▬ flat with ±0.5 RSI point deadzone to avoid flicker), and classic divergence cell (🔺/🔻/—)
◇ Row 6: Master row — displays "🌈 Master (~XhYm)" where XhYm is the geometric weighted mean of the 5 active timeframes (e.g. ~1h11m for the default 5/15/60/240/D set), with the Master's RSI value, trend arrow, and divergence state
◇ Row 7: MTF Divergence status row — tracks RSI alignment between TF1 and TF5
🔹 Antenna Marker
An antenna marker (📡) appears at the end of the timeframe label on the row whose timeframe matches the chart's native resolution. Start the read at the antenna row — that's your chart's RSI — then scan up to faster TFs and down to slower TFs to see whether they confirm or contradict the current read.
🔹 MTF Divergence Status Row (TF1 ↔ TF5)
Separate from the classic per-TF divergence: the status row at the bottom tracks RSI alignment between the fastest and slowest configured timeframes:
◇ Aligned (TF1 and TF5 in the same zone): trend continuation, no MTF divergence.
◇ Strong Divergence (TF1 ≥ 70 vs TF5 ≤ 30, or mirrored): fast and slow timeframes telling completely opposite stories. Common at major turning points.
◇ Moderate Divergence (TF1 ≥ 65 vs TF5 ≤ 40, or mirrored): partial misalignment between fast and slow.
PER-TIMEFRAME RSI LENGTH CUSTOMIZATION
🔹 What It Does
RSI period defaults to 14 globally — Wilder's canonical setting. Each of the 5 timeframes has an optional length override: zero means inherit the global default, any positive integer means use that period for that timeframe only.
🔹 Why It Helps
Real-world strategies often want different RSI sensitivities at different horizons. Scalpers use 7-9 on the trigger TF for fast signals while keeping 14 on slower TFs for stability. Swing traders use 14-21 on intraday TFs and 21+ on the daily for smoother reads. Connors-style strategies use 2 on the trigger for mean-reversion. The hybrid pattern keeps the settings panel clean for casual users (one input controls all) while letting power users specialize per TF when needed.
MULTILINGUAL INTERFACE
The indicator supports five languages for the HUD display, Legend Table headers, and alert messages: English (default), Português, Español, Русский, and 中文 (Chinese). Code, comments, and configuration tooltips remain in English regardless of the selected language. Tech abbreviations (RSI, MTF, HTF, TF) stay Latin in all language contexts — they are universally recognized in trading and translation would add noise.
For reference, the multilingual coverage includes:
◇ HUD title and all row labels
◇ Trend arrows (universal: ▲▼▬)
◇ Divergence cells (universal: 🔺🔻—)
◇ MTF Divergence status row (Aligned / Strong / Moderate, with Top/Bottom directional labeling)
◇ All alert messages including the new classic divergence alerts
HOW TO USE
This indicator is not a signal generator. It is a structural map: it tells you where RSI sits across multiple horizons, how aligned (or divergent) those horizons are, and where classic price↔RSI divergence is forming.
🔹 Reading the Rainbow
◇ Solid rainbow + Master near equilibrium (30–70 zone): no clear signal. Trending behavior absent.
◇ Solid rainbow + Master in Z-Alert (orange/teal): trend in motion across all horizons. Look for follow-through confirmation.
◇ Solid rainbow + Master in Z-Exhaustion (red/blue): elevated probability of mean reversion. Multiple horizons agreeing on saturation.
◇ Master touches Black Swan (purple/aqua glow): statistically rare overshoot. High-probability reversal setup, especially when the MTF Divergence row also fires Strong.
◇ Ghost lines visibly spread far from Master: synchrony breakdown. Wait for re-convergence before high-conviction entries.
🔹 Reading the Legend Table
◇ Antenna row (📡): your chart's native TF. Start there.
◇ Scan above the antenna: faster TFs. If they're in extremes opposite to the antenna, the local signal is conflicted.
◇ Scan below the antenna: slower TFs. If they're aligned with the antenna, the structural bias confirms.
◇ Master row: the integrated read. The "~XhYm" label tells you where Master sits in the TF spectrum.
🔹 Reading the Classic Divergence Layer
◇ Single TF lit up (e.g. only TF2 shows 🔻): local divergence. Often noise on fast TFs.
◇ Multiple TFs lit up in the same direction: structurally significant. Confluence of divergence across horizons.
◇ Master divergence drawn on chart + 2 or more TFs in same direction: high-conviction reversal setup. The strongest signal this indicator produces.
◇ Divergence appearing on slow TFs (TF4 / TF5) while fast TFs are quiet: often precedes major reversals — slow-horizon participants are pulling away before fast-horizon ones notice.
🔹 Tactical Reading
◇ Master in Z-Alert + MTF status Aligned: with-trend continuation setup.
◇ Master in Z-Exhaustion + Bear Div drawn on chart + 2 TFs 🔻: short setup with multi-horizon confirmation.
◇ Master at Black Swan Low + Bull Div drawn on chart + Strong MTF Divergence (TF1 ≤ 30 vs TF5 ≥ 70 mirrored): rare confluence of multiple exhaustion signals.
INPUTS EXPLAINED
🔹 System Language
Display language for the HUD and alert messages. Options: English (default), Português, Español, Русский, 中文 (Chinese).
🔹 Multi-Timeframe (TF1 to TF5)
Configure each of the five timeframes to scan. Defaults: 5m / 15m / 60m / 240m / Daily. Plus AI Auto-Sync option that adjusts the 5 TFs based on chart resolution.
🔹 Default RSI Length + 5 Per-TF Overrides
Default 14 applied globally; per-TF override is 0 by default (inherit). Set override > 0 to specialize per TF.
🔹 Dynamic Black Swan Mode
OFF (default): static 80/20 thresholds. ON: dynamic Fibonacci 3.85σ proportion of the Master channel.
🔹 Dynamic Channel Lookback + Smoothing
Lookback for highest/lowest of Master (default 50). EMA smoothing applied to the channel envelope (default 10).
🔹 Divergence Pivot Lookback
Lookback (bars before/after) for the classic divergence pivot detection. Default 5 — matches most community divergence indicators.
🔹 TF Colors + Show/Hide Toggles
Color and visibility for each of the 5 ghost lines. Hiding a TF does NOT remove it from the Master fusion — the calculation continues; visibility is purely visual.
🔹 Ghost Fade Sensitivity
Higher = ghost lines fade more aggressively as they diverge from the Master. Default 3.5 (invisible at ~20 RSI points apart).
🔹 Show Master Line / Fills / Black Swan / Channel / Legend Table / Static Levels / Div Column / Div Chart Line
Independent toggles for each visual layer.
🔹 Legend Table Position + Font Sizes
Position of the table (four corners) and separate font sizes for data rows and label rows.
🔹 Alert Toggles
Master crosses Black Swan High / Low — fires when Master crosses the threshold.
Strong MTF Divergence — fires when TF1 vs TF5 enter opposite extremes.
Master enters Z-Exhaustion — fires when Master enters the red/blue zone (OFF by default to avoid overlap with Black Swan alerts).
Master Classic Divergence — fires when classic bear or bull divergence is detected on the Master line (ON by default).
IMPORTANT NOTES
The MTF RSI Synchrony works on any timeframe. The default radar configuration (5m/15m/60m/240m/D) is calibrated for intraday and swing trading on liquid instruments. For position trading or scalping, the radar timeframes can be reconfigured to scan longer or shorter horizons respectively, or AI Auto-Sync can be enabled to let the engine pick automatically.
The script makes 10 request.security calls in total (5 for the RSI extraction + 5 for the per-TF divergence detection). On low-volatility chart resolutions or weaker hardware, chart load may take a moment longer than for a single-TF RSI; this is expected and normal.
Alerts fire once per confirmed bar (alert.freq_once_per_bar + barstate.isconfirmed gating). Historical bars never repaint after they close. The live bar updates intra-bar as expected for a real-time indicator.
The Fibonacci channel calibration (ratios 1.50 / 1.85 / 2.75 / 3.85) is the canonical Rainbow Matrix ratio set, also used in other portfolio scripts for consistency.
Pine Script v6. Open-source under Mozilla Public License 2.0.
UNIQUENESS
The MTF RSI Synchrony is unique in three ways. First, it performs RSI extraction across five timeframes simultaneously via request.security with Fibonacci-proportioned weights — the integrated Master Line is not a smoothed version of one TF but a true weighted fusion of five independent RSIs, with peak weight on the macro middle TFs where institutional decisions consolidate. Second, the per-timeframe RSIs are rendered as fade-by-distance ghost lines around the Master, transforming synchrony itself into a visible density property — when the timeframes align the rainbow is solid, when they diverge the ghost lines spread visibly across the pane, without requiring the trader to read numbers. Third, the classic divergence detection runs in parallel on each of the 5 timeframes plus the Master line, producing two complementary outputs: a per-TF Legend Table column for granular per-horizon insight and a Master-line chart visual (line connecting pivots + label) for the integrated MTF signal. The combination of weighted multi-timeframe fusion, density-based synchrony visualization, and two-layer divergence detection produces a structural map of RSI behavior that single-timeframe RSI indicators cannot provide — particularly at decision points where multiple horizons converge or where slow-horizon divergences emerge before they reach fast-horizon attention.
Wskaźnik Pine Script®
Crypto Ultimate Indicator v2═══════════════════════════════════════════════
CRYPTO ULTIMATE INDICATOR (CUI)
═══════════════════════════════════════════════
A multi-layer confluence system for crypto traders. Stacks 12+ independent technical layers — trend, momentum, volume, regime, multi-timeframe bias, and Smart Money Concepts — and fires Buy/Sell signals only when enough of them agree. Every signal comes with a confidence score, three take-profit levels, position size recommendation, and live outcome tracking.
Built for 4H and Daily crypto charts. No proprietary "secret sauce" — every component is documented and every input is exposed.
━━━━━━━ WHY THIS EXISTS ━━━━━━━
Most multi-indicator scripts stack correlated trend filters (more EMAs, more oscillators) and call it "confluence." That just adds the illusion of agreement without adding independent information.
CUI's filter stack is built from genuinely different signal sources, so when they align, that alignment carries real weight:
• Trend regime — HMA + Supertrend + EMA Ribbon
• Momentum — RSI with proper pivot-to-pivot divergence
• Volume flow — body-weighted Volume Delta + CVD divergence
• Volatility state — Bollinger squeeze + squeeze-release timing
• Market structure — composite of ADX, Choppiness Index, BB-width percentile
• Multi-timeframe — weighted Daily / Weekly / Custom HTF (all offset, no repaint)
• Liquidity & gaps — Fair Value Gaps + Liquidity Sweep detection
• External context — optional BTC trend filter for alt trading
A Buy or Sell only fires when the relevant subset of these align. A built-in "Why-Not" diagnostic table shows you exactly which filter is blocking a near-signal at any moment — turning the indicator into a tunable system rather than a black box.
━━━━━━━ CORE FEATURES ━━━━━━━
TREND & MOMENTUM
▸ Hull Moving Average (configurable length)
▸ Supertrend with ATR factor
▸ 5-EMA Ribbon (8/13/21/34/55) with stacking score
▸ RSI with consecutive-pivot divergence detection
▸ MACD and Stochastic RSI (data window)
VOLUME
▸ Body-weighted Volume Delta (not naive close-position)
▸ Cumulative Volume Delta (CVD)
▸ CVD divergence at confirmed pivots
VOLATILITY & REGIME
▸ Bollinger Bands with squeeze detection and release timing
▸ Composite regime classifier (ADX × CHOP × BB-width)
▸ Background tint for trending vs ranging states
▸ Regime transition labels
SMART MONEY CONCEPTS
▸ Fair Value Gap zones (bullish and bearish)
▸ Liquidity Sweep detection
MULTI-TIMEFRAME
▸ Daily / Weekly / User-defined custom HTF
▸ Weighted confluence score (D 1.0x + W 1.5x + Custom 0.75x)
▸ Optional HTF pivot-based S/R lines
BTC CONTEXT (for alt traders)
▸ Optional BTC trend filter
▸ Relative strength vs BTC
SIGNAL ENGINE
▸ 0-100 confidence score
▸ Configurable minimum confidence threshold
▸ Auto-tune presets (Aggressive / Balanced / Conservative / Custom)
▸ Confirmation bar requirement
▸ Minimum spacing between signals
TRADE MANAGEMENT
▸ Three take-profit levels (TP1/TP2/TP3) with configurable ATR multipliers
▸ Custom % allocation per target
▸ Adaptive SL/TP — different distances in trending vs ranging conditions
▸ Break-even stop activation after TP1
▸ Chandelier ATR trailing stop on runner portion
▸ Position size calculator (account size × risk % × confidence multiplier)
LIVE TRACKING & DIAGNOSTICS
▸ Main dashboard with all current state
▸ Signal log table — last N trades with live TP/SL outcomes
▸ Why-Not diagnostic — which filter is currently blocking each direction
▸ Regime stats — win rate broken down by trending vs ranging
ALERTS
▸ 15+ classic alertcondition triggers
▸ Optional JSON webhook payload for bot integration
━━━━━━━ HOW A BUY SIGNAL FIRES ━━━━━━━
All of the following must be true on the signal bar:
1. HMA trending up
2. RSI above 50
3. Volume delta positive
4. EMA Ribbon score ≥ +3 (at least 4 of 5 aligned bullish)
5. Supertrend bullish
6. HTF confluence score ≥ +1.5
7. Confidence score ≥ user minimum
8. BTC trend bullish (if BTC filter enabled)
9. Price not inside opposing FVG zone (if FVG filter enabled)
10. Market not in strong ranging mode
11. Price more than 0.5 ATR from upper resistance zone
12. Candle body > 50% of range
13. Minimum bars elapsed since last signal
14. Confirmation bar (if enabled)
A Sell signal requires the inverse. On 4H BTC expect roughly 1-3 signals per week in normal conditions. If you see fewer, drop the confidence floor or switch to the Aggressive preset.
━━━━━━━ RECOMMENDED USE ━━━━━━━
▸ Primary: 4H on BTC/USDT, ETH/USDT, and majors
▸ Also works: Daily, 12H, 8H
▸ Use caution below 1H — noise increases, news spikes can trigger wicks
▸ Low-liquidity alts: bump ATR period to 21
WORKFLOW
1. Start on the Balanced preset
2. Watch the dashboard and Why-Not panel for a few sessions
3. Adjust the confidence floor based on signal frequency
4. Enable Regime Stats after chart history accumulates
5. For bots: enable JSON webhook alerts, route via "Any alert() function call"
━━━━━━━ REPAINT DISCLOSURE ━━━━━━━
Full transparency on what does and doesn't repaint:
▸ HMA, Supertrend, EMA Ribbon: repaint on the developing current bar (use bar-close confirmation for live trading)
▸ HTF confluence (D/W/Custom): all use offset — fetch last closed HTF bar only — NO intra-period repaint, NO lookahead
▸ RSI and CVD divergence labels: plotted at confirmed pivot bar (5 bars after the actual pivot). Do NOT appear and disappear.
▸ FVG zones: drawn on confirmation bar of the 3-bar gap pattern. Do not repaint once drawn.
▸ Liquidity sweeps: detected on bar close
▸ Trade outcomes (signal log): evaluated on each closing bar
▸ Regime transition labels: confirmed on bar close
━━━━━━━ HONEST LIMITATIONS ━━━━━━━
▸ This is a decision-support tool, not a complete trading system. Risk management, position discipline, and execution matter more than any indicator.
▸ Signal outcomes in the Regime Stats table are based on bar-close evaluation. Real-fill slippage is not modeled.
▸ Volume Delta is approximated from candle structure, not true tick-level bid/ask (TradingView doesn't expose that without premium feeds).
▸ FVG and liquidity sweep are simplified interpretations of those concepts — pure SMC purists may prefer dedicated tools.
▸ The regime classifier is a heuristic composite. It works well on liquid crypto pairs but can lag at sharp inflection points.
▸ Past performance does not predict future results.
━━━━━━━ SETTINGS OVERVIEW ━━━━━━━
The script has many inputs, grouped by function. For first-time users, the most important groups are:
▸ Preset & Theme → pick Balanced to start
▸ UI Sizing → table text and label sizes
▸ Signal Engine → set Minimum Confidence Score
▸ Tiered Exits → TP/SL multipliers and % allocation
▸ Position Sizing → account size and risk per trade
▸ Alerts & Webhooks → enable JSON for bot trading
Default state shows a clean chart: HMA, Supertrend, BB, regime tint, signal labels, plus three tables (dashboard, signal log, HTF panel). Everything else is one toggle away — EMA Ribbon, FVG boxes, ATR zones, HTF S/R lines, CVD divergence labels, sweep markers, Why-Not diagnostic, Regime Stats.
━━━━━━━ WHAT'S NOT INCLUDED ━━━━━━━
▸ Full strategy() backtest — this is an indicator(). A companion strategy script may be released separately.
▸ Funding rate / open interest overlays — require specific tickers not universally available
▸ Chart pattern recognition (H&S, wedges, etc.)
━━━━━━━ CREDITS ━━━━━━━
Built on Pine Script v6. Uses TradingView built-ins: ta.supertrend, ta.dmi, ta.bb, ta.macd, ta.rsi, ta.pivothigh, ta.pivotlow, ta.valuewhen. Choppiness Index, CVD, FVG detection, liquidity sweep logic, regime classifier, confidence scoring, trade tracking, and confluence weighting are custom implementations.
═══════════════════════════════════════════════
Wskaźnik Pine Script®
MTF Kinetic Oscillator | Rainbow MatrixGENERAL OVERVIEW
The MTF Kinetic Oscillator is a multi-timeframe order-flow probability oscillator that fuses 5 timeframes into a single composite score, blended with three independent order-flow sensors (CVD, Volume Climax, Squeeze) and plotted against a self-adaptive Fibonacci channel that recalibrates to current volatility conditions. Instead of treating an oscillator as a fixed 0-100 envelope where the same threshold means the same thing across all market regimes, the indicator continuously classifies the current score against an adaptive channel — and colors the chart accordingly.
The main goal of this indicator is to give traders a clean, automatic read on where the order-flow consensus sits across 5 timeframes simultaneously, and how stretched that consensus is relative to its own recent statistical range — without having to manually monitor multiple oscillators on multiple timeframes. Every value the oscillator displays is the result of a weighted aggregation of 5 timeframe scores, modulated by order-flow sensors, and contextualized against an adaptive channel.
It plots a single score line that travels through five color zones (yellow, orange, red, purple for upper extremes; green, teal, blue, aqua for lower extremes), each corresponding to a probabilistic regime. Combined with the Info Panel HUD, Vacuum Trail convergence lines, and Black Swan dynamic glow, the indicator gives a complete read on order-flow direction, statistical position, and proximity to exhaustion zones — all from a single oscillator pane.
This indicator was developed for traders who already understand oscillator-based indicators (RSI, MFI, Stochastic, CCI) and want a multi-timeframe aggregation that calibrates its thresholds to current volatility instead of using fixed 0-100 boundaries.
WHAT IS THE THEORY BEHIND THIS INDICATOR?
Most oscillators on TradingView — RSI, MFI, CCI, Stochastic, and their derivatives — share two common architectural choices: they operate on a single timeframe, and they classify against fixed thresholds (typically 70/30 or 80/20). This treats every market regime as statistically equivalent.
The problem: market regimes are not equivalent. A score of 75 during a tight-range, low-volatility period is structurally different from a score of 75 during a volatile expansion phase. Fixed thresholds applied to a non-stationary distribution produce systematic mismatches — overbought readings that resolve into further upside, oversold readings that continue lower, signals that appear at the wrong moments precisely when volatility shifts regimes. This mismatch becomes most visible during transitions between volatility regimes: trend climaxes, capitulation lows, squeeze breakouts.
This indicator addresses both issues at once. First, the per-timeframe score is built from a Log-Normal Z-Score regression of price (which respects the asymmetric distribution of returns) blended with RSI through a sigmoid normalization. Second, the 5 per-timeframe scores are aggregated through Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15) into a single global score — giving the most weight to the middle macro horizons rather than the shortest or longest timeframes. Third, the global score is plotted not against fixed 0-100 thresholds, but against a self-adaptive channel whose boundaries are re-computed every bar from the highest and lowest scores in the lookback window, smoothed by EMA, and proportioned by Fibonacci ratios (1.50/1.85, 1.85/1.85, 2.75/1.85, 3.85/1.85).
The three order-flow sensors — CVD Z-Score, Volume Climax, and Squeeze — operate as modulators of the base score: the CVD bonus amplifies the score when directional order pressure dominates (clamped at ±12 points), Volume Climax drag dampens the score when abnormal volume is detected (statistical exhaustion signal), and the Squeeze damper compresses score amplitude to 25% during compressed-volatility regimes (suppressing false signals during low-conviction lateral phases).
Why traders use it: each color zone on the chart represents a different probabilistic regime, calibrated to current volatility. When the score sits between the median and the inner band (yellow/green), the order-flow consensus is in normal operating range — equilibrium. When the score crosses into the second band (orange/teal), the move has crossed into directional territory. The third band (red/blue) marks the threshold beyond which most of the impulse has already happened — exhaustion. The fourth band (purple/aqua) marks the tail of the distribution — a Black Swan event in Taleb's sense — where score positions rarely persist under normal volatility conditions.
The three order-flow sensors and the adaptive Fibonacci channel are not independent layers stacked in the same pane. They map three different aspects of the same question: where the multi-timeframe order-flow consensus currently sits (the score), how that consensus is being modulated by live order-flow pressure (the sensors), and how stretched that modulated value is relative to its own recent statistical range (the channel). The integration of all three components into a single oscillator is the reason they exist in one script rather than as three separate indicators: the cross-component blending is what surfaces multi-sensor confluence that separate-script approaches cannot produce.
MTF KINETIC OSCILLATOR FEATURES
The indicator includes 6 main features:
Multi-Timeframe Score Engine
CVD Order-Flow Sensor
Volume Climax and Squeeze Sensors
Adaptive Fibonacci Channel
Vacuum Trail and Black Swan Dynamic Glow
Info Panel HUD and Alerts
Multilingual interface and full customization across all visual layers.
MULTI-TIMEFRAME SCORE ENGINE
🔹 What It Does
The core of the indicator. For each of the 5 configured radar timeframes, the engine performs three operations:
◇ Calculates a Log-Normal Z-Score regression of price (hlc3 transformed via natural logarithm, fitted with linear regression, residuals normalized by their own standard deviation).
◇ Computes a per-timeframe RSI at a Fibonacci-aligned length (8, 13, 21, 34, 55 — one per timeframe).
◇ Blends the Z-Score (via sigmoid normalization) and the RSI into a single per-timeframe score, bounded 0-100.
The 5 per-timeframe scores are then aggregated through Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15) into a single global score representing the multi-horizon order-flow consensus.
🔹 Method
The regression runs in log space, addressing the asymmetric nature of price distribution that linear estimators (such as the Simple Moving Average) fail to account for. The directional reference (high vs low) is selected per bar based on candle direction — green candles use the high (upward pressure reference), red candles use the low (downward pressure reference). This produces a Z-Score that reflects the directional intent of each bar rather than the midpoint average.
The sigmoid normalization compresses Z-Scores into a bounded 0-100 range without losing the asymmetric information of extreme values. The RSI component anchors the score to a familiar momentum reference, blending two independent signal families into one bounded value per timeframe.
🔹 Hierarchical Weighting
The five timeframes are weighted by structural significance using Fibonacci proportions:
◇ TF1 (Trigger, default 5): weight 15% — fastest reactivity, lowest weight.
◇ TF2 (Intraday, default 13): weight 20% — session-scale resolution.
◇ TF3 (Macro 1, default 55): weight 25% — backbone of the score.
◇ TF4 (Macro 2, default 233): weight 25% — institutional reference horizon.
◇ TF5 (Base, default 987): weight 15% — macro trend anchor.
The middle horizons (TF3 and TF4) carry the highest weight because they typically represent the most structurally significant reference for institutional decision-making — short enough to react to current conditions, long enough to filter intraday noise.
CVD ORDER-FLOW SENSOR
🔹 What It Does
The CVD (Cumulative Volume Delta) sensor estimates the difference between buyer and seller volume per bar — measuring market-order aggression. The signed delta is normalized to a Z-Score against a 50-period rolling reference, and the resulting bonus is clamped at ±12 points before being added to the global score.
🔹 Method
For each bar, total volume is split between buyer share (proportional to `close - low / range`) and seller share (proportional to `high - close / range`). The signed delta is the difference. A 50-period mean and standard deviation define the reference; the current delta is expressed as a Z-Score against that reference, then multiplied by 4 and clamped to ±12 to control its contribution to the final score.
🔹 Why It Matters
The Z-Score component answers "where is the multi-timeframe consensus", and the RSI component answers "what is the momentum". The CVD sensor answers a separate question: "who is currently aggressive in the order book". When the multi-timeframe consensus is bullish and CVD aggression confirms it, the bonus amplifies the score. When the consensus is bullish but CVD shows seller aggression, the bonus subtracts from the score — surfacing a divergence between consensus and order-flow.
VOLUME CLIMAX AND SQUEEZE SENSORS
🔹 Volume Climax
A standalone sensor that detects abnormal volume conditions (volume Z-Score above 3.0). When triggered, a climax drag is applied to the score, signaling potential exhaustion. The HUD reports this state explicitly in the Status row.
🔹 Squeeze
A volatility-compression detector based on the percentage-rank of the current range against a 20-period lookback. When the range compresses to its 15th percentile or lower, the squeeze flag activates and the score amplitude is dampened to 25% of its normal range — preventing false directional signals during compressed-volatility regimes.
🔹 Why They Matter
These sensors operate on a different axis from the price-direction sensors. Volume Climax surfaces statistical exhaustion before it becomes visible in price; Squeeze suppresses noise during periods when the oscillator would otherwise produce false reads. Together they make the oscillator behave correctly during regime transitions, where standard oscillators are typically least reliable.
ADAPTIVE FIBONACCI CHANNEL
🔹 What It Does
The global score is plotted against a self-adaptive channel rather than against fixed 0-100 thresholds. The channel boundaries are re-computed every bar from the highest and lowest scores in a 50-bar lookback window, smoothed by 10-period EMA, and then proportioned through Fibonacci ratios into four zones:
◇ Z-Breathing (inner, yellow/green) — ratio 1.50 / 1.85 (≈ 0.811)
◇ Z-Alert (upper limit, orange/teal) — ratio 1.85 / 1.85 = 1.000 (the visible anchor)
◇ Z-Exhaustion (outer, red/blue) — ratio 2.75 / 1.85 (≈ 1.486)
◇ Black Swan (extreme edge, purple/aqua) — ratio 3.85 / 1.85 (≈ 2.081)
🔹 Why It Adapts
Fixed thresholds (70/30 or 80/20) treat every volatility regime as equivalent. The adaptive channel calibrates the rainbow visual to the actual statistical envelope of the current regime — overbought during a low-volatility consolidation does not mean the same as overbought during a volatility expansion, and the channel reflects that.
🔹 Visual Rendering
The space between adjacent channel boundaries is filled with a semi-transparent color matching the zone palette (toggleable via "Show Thermal Zone Fills"). This makes the current zone immediately visible without having to read the score number — the visual position alone tells you the regime.
VACUUM TRAIL AND BLACK SWAN DYNAMIC GLOW
🔹 Vacuum Trail
Ghost convergence lines projecting from exhaustion extremes back toward the channel median. The lines anchor at a level 15% inside the inner Breathing zone (not at the channel boundary itself), which produces visual convergence inward rather than along the edge — useful for anticipating the typical mean-reversion path after extreme touches.
🔹 Black Swan Dynamic Glow
The outermost ±3.85σ-equivalent boundaries are rendered as a main line plus a wide outer glow whose intensity scales with the score's distance from the boundary. The glow becomes bright when the score is near the Black Swan zone and fades when far — drawing visual attention only when the statistical tail is approached.
🔹 Why They Matter
Both elements give the oscillator a sense of direction beyond the score's current position: the Vacuum Trail visualizes the expected return path during exhaustion; the Black Swan Glow makes statistical tail events visible at a glance, before the score itself crosses the boundary.
INFO PANEL HUD AND ALERTS
🔹 What the HUD Shows
A compact corner panel reports six live values:
◇ SCORE — the current global score (0-100) with color matching the active channel zone
◇ PROB. — the absolute probability (distance from neutral 50 expressed as percentage)
◇ DIRECTION — BUY / SELL / NEUTRAL based on score position relative to the median
◇ CHANNEL — current channel regime classification (Uptrend / Downtrend / Sideways / Compression / Expansion)
◇ RHYTHM — score velocity classification (Fast / Slow)
◇ STATUS — Black Swan / Squeeze / Climax / Neutral, prioritized by severity
🔹 Customization
The HUD can be positioned in any of the four chart corners and rendered in any of five font sizes. The display language is controlled by the System Language input.
🔹 Alerts
Three alert types are available:
◇ Exhaustion Alert — fires when the score crosses above 85% (buying exhaustion) or below 15% (selling exhaustion).
◇ Squeeze Alert — fires when the squeeze flag activates (volatility compression detected).
◇ Black Swan Alert — fires when the score enters the ±3.85σ-equivalent extreme zone; uses an edge-trigger arm/disarm mechanism (fires once on entry, locks while inside, re-arms only on exit).
All alerts are gated by `barstate.isconfirmed` and use `alert.freq_once_per_bar` to prevent duplicate firings on the same candle. Five `alertcondition` blocks are also exposed for users who prefer the TradingView alert UI.
MULTILINGUAL INTERFACE
The indicator supports five languages for the HUD display and alert messages: English (default), Português, Español, Русский, and 中文 (Chinese). Code, comments, group names and input labels remain in English regardless of the selected language.
For reference, the English text of all multilingual UI strings used in the HUD and alerts:
◇ BUY / SELL / NEUTRAL — direction states
◇ SQUEEZE — Low Volatility. Await the Explosion.
◇ CLIMAX — Abnormal Volume Detected. Possible Exhaustion.
◇ UPTREND / DOWNTREND / SIDEWAYS / COMPRESSION / EXPANSION — channel states
◇ FAST / SLOW — rhythm states
◇ SCORE: / DIRECTION: / CHANNEL: / RHYTHM:
◇ BLACK SWAN — EXTREME HIGH / BLACK SWAN — EXTREME LOW
◇ Buying Exhaustion Alert: " Buying Exhaustion: Score above 85%. High reversal probability."
◇ Selling Exhaustion Alert: " Selling Exhaustion: Score below 15%. High reversal probability."
◇ Squeeze Alert: " Squeeze Active: Volatility maximally compressed. Explosion imminent."
◇ Black Swan Alert: " Score reached the dynamic channel's extreme zone. Maximum statistical tension. Reversal probable."
HOW TO USE
This indicator is not a signal generator. It is a state classifier: it tells you where the multi-timeframe order-flow consensus currently sits, how stretched that consensus is relative to its own recent statistical range, and which order-flow regime (climax, squeeze, normal) is currently active.
🔹 Reading the Oscillator
◇ The score line color matches the active channel zone — visual position alone identifies the regime.
◇ The HUD reports the score numerically and classifies the channel/rhythm/status in plain language.
◇ Vacuum Trail lines indicate the expected mean-reversion path during exhaustion conditions.
◇ Black Swan glow intensity scales with proximity to the statistical extreme.
🔹 Tactical Reading
◇ Score between dyn_mid and inner band: equilibrium zone. Order-flow consensus is in normal range.
◇ Score crossing into the Alert band: directional move asserting itself across multiple timeframes.
◇ Score at the Exhaustion band: most of the impulse has already happened — continuation in trend direction becomes structurally less favorable.
◇ Score touching the Black Swan band: statistical tail event. Mean-reversion context is elevated, but regime change is also possible — the boundary itself is adaptive, so a sustained breach indicates the volatility envelope expanding.
◇ Squeeze state active: oscillator is operating in low-conviction mode. Wait for squeeze release before trusting directional reads.
◇ Climax state active: abnormal volume has been detected. Exhaustion context is present regardless of score position.
🔹 Multi-Timeframe Reading
◇ The default radar configuration (5/13/55/233/987) follows Fibonacci minute periods and is calibrated for intraday and swing trading.
◇ For scalping, configure shorter timeframes (e.g., 1/3/8/21/55).
◇ For position trading, configure longer timeframes (e.g., 60/240/D/W/M).
◇ The middle-weighted timeframes (TF3 and TF4) carry the most influence — choose them carefully.
INPUTS EXPLAINED
🔹 System Language
Display language for the HUD and alert messages. Options: English (default), Português, Español, Русский, 中文 (Chinese).
🔹 MTF Synchronization (TF1 to TF5)
Configure each of the five timeframes to aggregate. Defaults: 5, 13, 55, 233, 987 (Fibonacci minutes). Weights are fixed at 15/20/25/25/15 percent respectively.
🔹 Show Thermal Zone Fills
Toggle for the semi-transparent rainbow fills between adjacent channel boundaries.
🔹 Show Vacuum Trail (Ghost Lines)
Toggle for the convergence ghost lines from exhaustion extremes back toward the channel median.
🔹 Show Dynamic Median Line
Toggle for the channel midline (dyn_mid) — the adaptive zero-reference of the oscillator.
🔹 Show Black Swan Lines (Dynamic Glow)
Toggle for the outermost ±3.85σ-equivalent boundaries with proximity glow.
🔹 Show Info Panel
Toggle for the corner HUD reporting score, direction, channel, rhythm, and status.
🔹 Panel Position
Position of the HUD on the chart. Four corners available: Bottom Right (default), Bottom Left, Top Right, Top Left.
🔹 Font Size
HUD font size. Options: Tiny (default), Small, Normal, Large, Huge.
🔹 Exhaustion Alert
Toggle for the alert that fires when the score crosses ±85/15 thresholds.
🔹 Squeeze Alert
Toggle for the alert that fires when the squeeze flag activates.
🔹 Black Swan Alert
Toggle for the alert that fires when the score enters the adaptive extreme zone.
IMPORTANT NOTES
The MTF Kinetic Oscillator works on any timeframe. The default MTF configuration (5/13/55/233/987 in minutes) is calibrated for intraday and swing trading on liquid instruments. The Fibonacci-aligned RSI lengths (8/13/21/34/55) and per-timeframe data lengths (288/96/72/60/40) are tuned to provide roughly equivalent statistical resolution across all five horizons.
The indicator works best on instruments with reliable volume data: crypto perpetual contracts, large-cap equities, futures, major forex pairs. On low-volume instruments, the CVD component becomes less reliable, though the score engine and channel continue to function correctly using the Z-Score and RSI components alone.
Alerts fire once per confirmed bar. The Black Swan alert uses an edge-trigger arm/disarm mechanism that prevents repeated firings while the score remains inside the extreme zone. Historical bars never repaint after they close. The live bar updates intra-bar as expected for a real-time indicator.
The Value Area calibration factor (vp_k = 2.51) used internally by the score engine for the Volume Profile distance component is tuned to approximate the conventional 70% Value Area definition. The Fibonacci sigma multipliers (1.50, 1.85, 2.75, 3.85) used by the adaptive channel are intentionally non-standard — they are Fibonacci-inspired proportions, not arbitrary choices, and they map to four behavioral regimes derived from observation rather than to integer statistical thresholds.
Pine Script v6. Open-source under Mozilla Public License 2.0.
UNIQUENESS
The MTF Kinetic Oscillator is unique in four ways. First, it operates across 5 timeframes simultaneously, aggregating per-timeframe scores via Fibonacci-proportioned weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15) rather than operating on a single timeframe like RSI, MFI, CCI, or Stochastic. Second, the per-timeframe score is built from a Log-Normal Z-Score regression of price (which respects the asymmetric distribution of returns) blended with RSI through sigmoid normalization — producing a bounded composite that combines two independent signal families per horizon. Third, the global score is plotted not against fixed 0-100 thresholds but against a self-adaptive Fibonacci channel whose boundaries are recomputed every bar from the highest and lowest scores in the lookback window — calibrating the rainbow visual to current volatility regime rather than to static numerical levels. Fourth, three independent order-flow sensors (CVD Z-Score, Volume Climax detection, and Squeeze volatility compression) modulate the score continuously, with the Squeeze damper compressing score amplitude to 25% during low-conviction lateral phases — suppressing false directional signals at exactly the moments standard oscillators are typically least reliable. The combination of Fibonacci-weighted multi-timeframe aggregation, log-space Z-Score plus RSI per timeframe, adaptive Fibonacci channel, and three order-flow modulators produces an oscillator that behaves differently from single-timeframe and fixed-threshold oscillators, particularly during volatility regime transitions where standard oscillators are least reliable.
Wskaźnik Pine Script®
MGI Walls | Rainbow MatrixGENERAL OVERVIEW
The MGI Walls is a multi-timeframe institutional liquidity radar that extracts and renders the price zones where institutional capital concentrates: Volume Profile blocks (Point of Control, Value Area High, Value Area Low), Anchored VWAPs, and Parabolic SAR levels. Instead of showing these levels for a single chart timeframe, the indicator scans up to five macro timeframes simultaneously and merges overlapping zones into a single intensified block whenever multiple timeframes agree on the same price area.
The main goal of this indicator is to give traders a clean, automatic read on where the structural barriers in the market are — without having to manually flip between timeframes, mark POCs by hand, or guess which level the next reaction will respect. Every line, box, and confluence zone you see on the chart was extracted from real volume distribution data, not drawn manually.
It plots up to four level types per timeframe (POC, VAH, VAL, VWAP, SAR), each weighted by the structural significance of its timeframe — a Weekly POC carries five times the gravitational weight of a 15-minute POC. The Wall Fusion Engine then detects when levels from different timeframes fall within a configurable percentage threshold and consolidates them into a single block. The Nearest Wall HUD panel and the institutional collision alerts complete the toolkit.
This indicator was developed for traders who already understand Volume Profile and VWAP concepts and want to see them across multiple timeframes in a single visual, with automatic confluence detection.
WHAT IS THE THEORY BEHIND THIS INDICATOR?
Most Volume Profile indicators on TradingView — including the standard built-in profiles, Fixed Range Volume Profile, and the various session/visible-range derivatives — share a common architectural choice: they operate on a single timeframe. They show you the POC and Value Area for the current chart only. This treats each timeframe as an isolated decision space.
The problem: institutional flow is not isolated to one timeframe. The market makers operating on the daily horizon see different value areas than those operating on the weekly or 4-hour horizon. Their orders sit at their own POCs and Value Area boundaries. When price approaches a level that only one institutional horizon defends, the reaction is often modest. When price approaches a level that multiple horizons defend simultaneously, the reaction is structurally stronger — that confluence is where the largest pools of resting liquidity accumulate.
This indicator addresses that by performing the extraction across five user-configured timeframes simultaneously via `request.security()`, weighting each level by the gravitational significance of its parent timeframe, and then fusing levels from different timeframes that fall within a configurable margin. The math is standard Volume Profile (POC at the volume-weighted mode, VAH/VAL at the ±2.51σ boundary that approximates the 70% Value Area) — what makes it useful is doing it across five timeframes at once, with hierarchical weighting and confluence merging.
Why traders use it: each block represents an institutional decision zone. A standalone POC line from the 15-minute timeframe is a local reaction point. A POC line that simultaneously aligns with the 4-hour VAH and the daily VWAP is a multi-horizon barrier — a zone defended by three independent pools of institutional capital at once. The fusion engine makes these confluences immediately visible as thicker, more opaque blocks; the polarity of each block reflects the accumulated weight balance of the levels that compose it, not the polarity of the last level to be merged.
The three rendered components — Volume Profile zones, Anchored VWAPs, and Parabolic SAR levels — are not independent layers stacked on the same chart. They map three different aspects of institutional positioning at the same set of timeframes: where past volume concentrated (Volume Profile), where the live volume-weighted consensus price currently sits (VWAPs), and which directional trend regime each timeframe is in (SARs). The Wall Fusion Engine operates across all three layers indiscriminately — a POC from the 4-hour timeframe and a VWAP from the daily timeframe at the same price are fused into a single block, because from the perspective of institutional defense they represent the same structural barrier reinforced by two independent mechanisms. This integration is the reason the three components exist in a single script rather than as three separate indicators: the cross-layer fusion is what surfaces multi-mechanism confluence, which a separate-script approach cannot do.
MGI WALLS FEATURES
The indicator includes 6 main features:
Multi-Timeframe Volume Profile Engine
Anchored MTF VWAPs
Parabolic SAR Levels (MTF)
Wall Fusion Engine with Polarity-Balance Coloring
Nearest Wall HUD Panel
Institutional Collision Alerts
Multilingual interface and full customization across all visual layers.
MULTI-TIMEFRAME VOLUME PROFILE ENGINE
🔹 What It Does
The core of the indicator. For each of the five configured radar timeframes, the engine performs three operations:
◇ Locates the price level that received the highest traded volume in the lookback window — the Point of Control (POC).
◇ Computes the volume-weighted standard deviation of price around that POC.
◇ Builds the Value Area High (VAH) and Value Area Low (VAL) at a calibrated multiplier (±2.51σ) of that deviation, approximating the price range that contained 70% of the total volume.
The result is three institutional reference levels per timeframe — POC, VAH, VAL — extracted natively at the granularity of each timeframe rather than approximated from the current chart's data.
🔹 Method
The extraction runs via `request.security()` with `lookahead=barmerge.lookahead_off` to prevent repainting. The POC is identified as the volume-weighted mode within the lookback window. The Value Area boundaries are derived statistically from the volume-weighted variance of price around the POC, using a calibration factor (vp_k = 2.51) tuned to approximate the conventional 70% Value Area definition. Each level is plotted on the chart as a line or box at its native price location, color-coded by whether it sits above (resistance) or below (support) the current price, and weighted by the timeframe it originated from.
🔹 Hierarchical Weighting
The five timeframes are weighted by structural significance:
◇ TF1 (Micro, default 15m): weight 1 — local reaction point.
◇ TF2 (Intraday, default 1h): weight 1 — session-scale level.
◇ TF3 (Macro 1, default 4h): weight 2 — multi-session level.
◇ TF4 (Macro 2, default Daily): weight 3 — multi-day level.
◇ TF5 (Global, default Weekly): weight 5 — multi-week structural barrier.
The weight controls visual prominence (opacity, border thickness) and, when fusion occurs, the contribution of each level to the polarity balance of the resulting block.
ANCHORED MTF VWAPS
🔹 What It Does
For each of the five radar timeframes, an Anchored VWAP is extracted and rendered as a separate level. The Global VWAP — the average of all five — is also plotted, marked with a globe emoji to distinguish it from the per-timeframe VWAPs.
🔹 Method
The per-timeframe VWAP is computed via a volume-weighted moving average of hlc3 on the native bars of each timeframe, then reported back to the current chart through `request.security()`. The Global VWAP is the unweighted average of the five timeframe VWAPs that are currently available (NA values are skipped).
🔹 Why It Matters
The Volume Profile blocks tell you where past volume concentrated. The VWAPs tell you what the volume-weighted consensus price is for each horizon, updated bar by bar. Together they give a complete read on every bar: where the past institutional reference zones are (the blocks) and where the live volume-weighted average for each horizon currently sits (the VWAPs).
PARABOLIC SAR LEVELS (MTF)
🔹 What It Does
The Parabolic SAR for each of the five radar timeframes is extracted and rendered as an institutional trend-direction anchor. SAR levels are toggleable independently of the Volume Profile and VWAP layers.
🔹 Why It Matters
The SAR provides a directional trend reference per timeframe — when the Weekly SAR sits above price and the Daily SAR sits below, the structure is in conflict and the resolution of that conflict often drives the next swing. When multiple SARs align on the same side, the directional bias is structurally agreed across horizons.
WALL FUSION ENGINE WITH POLARITY-BALANCE COLORING
🔹 What It Does
When two or more levels from different timeframes fall within a configurable percentage threshold (default 0.30%), the engine fuses them into a single block. The fused block inherits the combined weight of all its components — visually thicker, more opaque, more visible than a standalone level. The label of the fused block accumulates the directional triangles of each contributing level (▲ for support, ▼ for resistance).
🔹 Polarity-Balance Coloring
The color of a fused block reflects the accumulated weight balance of its constituent levels — not the polarity of the last level to be merged. A block containing four resistance levels (▼▼▼▼) and two support levels (▲▲) will render red, because the resistance weight dominates. A block where support and resistance weights are equal uses a tiebreaker: the position of the current price relative to the block's midpoint. Price above midpoint resolves to support (green); price below resolves to resistance (red). This produces a coloring scheme that is internally consistent with the triangle labels and with the price's current location.
🔹 Customization
The Wall Merge Margin (%) input controls how aggressively levels are fused. Lower values produce many separate precise lines. Higher values produce massive consolidated institutional blocks. The default of 0.30% is calibrated for liquid instruments on intraday timeframes; for higher-volatility assets or higher timeframes, larger margins (0.50–1.00%) may produce more readable charts.
NEAREST WALL HUD PANEL
🔹 What It Shows
A compact corner panel reports four live values:
◇ RESISTANCE — the price of the nearest wall above the current price
◇ DIST. — the percentage distance from current price to that resistance
◇ SUPPORT — the price of the nearest wall below the current price
◇ DIST. — the percentage distance from current price to that support
The distances are computed against the midpoint of each fused block, so the values reflect the consolidated wall, not any single contributing level.
🔹 Why It Helps
The HUD removes the need to visually measure distances to the walls on every bar. It tells you in plain numerical form how far the nearest barriers are in each direction. Useful for stop placement, target placement, and live decision-making where the visual chart is busy with multiple levels.
🔹 Customization
The HUD can be positioned in any of the four chart corners and rendered in any of five font sizes. The display language is controlled by the System Language input.
snapshot
INSTITUTIONAL COLLISION ALERTS
🔹 What Triggers
Two alert types are available:
◇ VWAP Collision — fires when price crosses or touches the daily, weekly, or monthly VWAP within a 0.15% proximity band.
◇ Volume Profile Wall Hit — fires when price crosses or touches the Global POC, VAH, or VAL within the same proximity band.
🔹 How They Fire
Alerts are gated by `barstate.isconfirmed`, which means they only trigger on the close of the bar that touched the level — not intra-bar. This prevents false signals from wicks that get rejected before the bar closes. Each alert uses `alert.freq_once_per_bar`, ensuring no duplicate firings on the same candle.
🔹 alertcondition() Mode
For users who prefer the TradingView alert UI rather than the `alert()` function call, two `alertcondition` blocks are also exposed: "VWAP Collision" and "Volume Profile Wall Hit". A third dummy `alertcondition` titled "HOW TO SETUP ALERTS (READ)" provides setup guidance in the alert condition menu.
MULTILINGUAL INTERFACE
The indicator supports five languages for the HUD display and alert messages: English (default), Português, Español, Русский, and 中文 (Chinese). Code, comments, and configuration tooltips remain in English regardless of the selected language.
For reference, the English text of all multilingual UI strings used in the HUD and alerts:
◇ (SUPPORT) / (RESISTANCE) — appended to wall labels indicating polarity
◇ RESISTANCE: / SUPPORT: — HUD row labels for nearest walls
◇ DIST.: — HUD row label for distance percentage
◇ VWAP Collision Alert: "🛡️ Price collided with Institutional VWAP. Defense zone active."
◇ Volume Profile Wall Alert: "🧱 Price hit Macro Volume Profile zone (POC/VAH/VAL). Institutional decision imminent."
HOW TO USE
This indicator is not a signal generator. It is a structural map: it tells you where the institutional barriers are, how strong each one is (by weight and fusion), and how far the nearest one is in each direction.
🔹 Reading the Walls
◇ Each line or block on the chart marks an institutional decision zone.
◇ The triangles in the label (▲ or ▼) and their count indicate the polarity and weight of the level.
◇ Walls with multiple triangles in the same direction are stronger reaction points than single-triangle walls.
◇ A block with mixed triangles is a fused confluence — the color shows which side dominates by weight.
🔹 Reading the HUD
◇ The HUD reports the nearest resistance above and nearest support below the current price.
◇ The percentage distances help size stops and targets against the structural barriers rather than against arbitrary fixed values.
🔹 Tactical Reading
◇ Price approaching a heavy multi-triangle wall: zone of elevated structural significance, where multiple institutional horizons coincide.
◇ Price sitting between two close walls of opposite polarity: ranging structure, defined by two opposing barriers of comparable weight.
◇ Price breaking through a heavy wall on confirmed close: structural shift. The wall often inverts polarity on subsequent retests.
◇ VWAP collision alerts: useful as a contextual reference for mean-reversion or trend-continuation analysis.
🔹 Multi-Timeframe Reading
◇ On lower timeframes (1m, 5m, 15m), configure shorter radar timeframes to track intraday institutional flow.
◇ On higher timeframes (1h, 4h, daily), keep the default 15m/1h/4h/D/W configuration to read multi-day and multi-week structural zones.
◇ The Global VWAP and Global POC (marked with 🌎) represent the consensus across all five timeframes — the most structurally significant single reference.
INPUTS EXPLAINED
🔹 System Language
Display language for the HUD and alert messages. Options: English (default), Português, Español, Русский, 中文 (Chinese).
🔹 Radar Timeframes (TF1 to TF5)
Configure each of the five macro periods to scan. Defaults: 15m, 1h, 4h, Daily, Weekly. The shortest timeframe carries weight 1; the longest carries weight 5.
🔹 Show MTF VWAPs (Radar)
Toggle for the Volume-Weighted Average Price extracted from each radar timeframe.
🔹 Show POC Lines
Toggle for the Point of Control lines — the price level with the highest traded volume in each timeframe.
🔹 Show VA Boxes (VAH / VAL)
Toggle for the Value Area High and Value Area Low — the upper and lower boundaries of the 70% volume zone.
🔹 Show SAR Levels
Toggle for the Parabolic SAR levels from each timeframe.
🔹 Fuse Overlapping Walls
Toggle for the confluence merging engine. When enabled, levels from different timeframes that fall within the Wall Merge Margin are consolidated into a single intensified block.
🔹 Wall Merge Margin (%)
Distance threshold to fuse nearby walls. Range 0.01–3.00, default 0.30. Lower values produce separate precise lines; higher values produce consolidated institutional blocks.
🔹 Show Nearest Wall Panel
Toggle for the corner HUD reporting nearest resistance, nearest support, and the percentage distances.
🔹 Panel Position
Position of the HUD on the chart. Four corners available: Top Right (default), Top Left, Bottom Right, Bottom Left.
🔹 Font Size
HUD font size. Options: Tiny, Small (default), Normal, Large, Huge.
🔹 VWAP Collision Alert
Toggle for the alert that fires when price collides with the daily, weekly, or monthly VWAP.
🔹 Volume Profile Wall Alert (POC/VAH/VAL)
Toggle for the alert that fires when price touches the Global POC, VAH, or VAL.
IMPORTANT NOTES
The MGI Walls works on any timeframe. The default radar configuration (15m/1h/4h/D/W) is calibrated for intraday and swing trading on liquid instruments. For position trading or scalping, the radar timeframes can be reconfigured to scan longer or shorter horizons respectively.
The indicator works best on instruments with reliable volume data: crypto perpetual contracts, large-cap equities, futures, major forex pairs. On low-volume instruments, the Volume Profile component becomes less reliable, though the VWAP and SAR components continue to function correctly.
Alerts fire once per confirmed bar. Historical bars never repaint after they close. The live bar updates intra-bar as expected for a real-time indicator.
The Value Area calibration factor (vp_k = 2.51) is tuned to approximate the conventional 70% Value Area definition under volume-weighted standard deviation. It is a calibration constant derived from observation rather than an arbitrary choice.
Pine Script v6. Open-source under Mozilla Public License 2.0.
UNIQUENESS
The MGI Walls is unique in three ways. First, it performs the Volume Profile, VWAP, and SAR extraction across five timeframes simultaneously rather than on the current chart only, surfacing the institutional reference zones that multiple time horizons agree on rather than only those visible on the active timeframe. Second, it weights each level by the structural significance of its parent timeframe — a Weekly POC carries five times the gravitational weight of a 15-minute POC — and the Wall Fusion Engine consolidates levels from different timeframes that fall within a configurable margin into a single intensified block, making multi-horizon confluence zones immediately visible as visually thicker walls. Third, the fused-block coloring reflects the accumulated weight balance of all constituent levels rather than the polarity of the last level to be merged, producing a visual scheme that is internally consistent with the triangle labels (▲ for support, ▼ for resistance) and with the price's current position relative to the block. The combination of multi-timeframe simultaneous extraction, hierarchical weighting with automatic confluence fusion, and balance-driven block coloring produces a structural map that behaves differently from single-timeframe Volume Profile indicators, particularly at price zones where multiple institutional horizons converge and where the strongest reactions tend to occur.
PUBLICATION METADATA (handoff to operator — not part of description)
Title: MGI Walls | Rainbow Matrix
Visibility: Open-source / Public
Category suggestion: Volume-based (primary) — TradingView's category for Volume Profile / volume-driven indicators
Tag suggestions (TV allows up to 10; pick the 9 most relevant):
- volume-profile
- poc
- value-area
- vwap
- multi-timeframe
- mtf
- confluence
- institutional
- support-resistance
- parabolic-sar (optional, swap for one above if SAR is a key selling point)
License declaration: Mozilla Public License 2.0 (already in script header)
Screenshot slots in the description (5 "snapshot" placeholders):
1. After GENERAL OVERVIEW — wide chart showing the indicator running on BTC or major instrument, with walls visible across multiple TFs
2. After Multi-Timeframe Volume Profile Engine section — chart annotated with POC/VAH/VAL lines from different TFs
3. After Wall Fusion Engine section — close-up of a fused confluence block with mixed triangles (▲▼) and the polarity-balance color clearly visible
4. After Nearest Wall HUD Panel section — HUD close-up showing the 5-row layout with real values
5. (Optional, swap into one of the above slots) — Black Swan-style touch event showing a collision alert firing
Wskaźnik Pine Script®
Liquidity Timeframe Stack Map [AGPro Series]Liquidity Timeframe Stack Map
🧠 Core Idea
Are lower-timeframe liquidity sweeps aligned with the higher-timeframe liquidity shelf, or are they fighting the broader structure?
📌 Overview / What it does
Liquidity Timeframe Stack Map is a multi-timeframe liquidity context tool built to compare current-chart sweep behavior with higher-timeframe liquidity shelves.
The script maps the latest confirmed higher-timeframe upper and lower liquidity shelves, detects local buy-side and sell-side sweeps, evaluates wick-based reaction quality, and converts the result into a readable stack state.
It does not predict price direction, automate trades, or claim that every sweep will create a reversal. It is designed as a structured market context and visualization tool.
🎯 Purpose & Design Philosophy
This script was built to solve a common liquidity-reading problem:
A lower-timeframe sweep can look important by itself, but its meaning changes when it happens near a higher-timeframe shelf.
The goal is to help traders separate aligned liquidity reactions from isolated local noise. The script supports a context-first mindset: read the shelf, read the sweep, then judge whether the reaction is aligned or conflicting.
⚡ Why This Script Is Different
Most liquidity tools focus on detecting a sweep, stop run, equal high, or equal low.
This script does NOT treat every sweep as equally important.
Instead, it compares the local sweep against a higher-timeframe liquidity framework and classifies whether the move is a stack alignment, a stack conflict, or a neutral shelf interaction.
⚙️ Methodology
1. Higher-Timeframe Shelf Detection
The script reads confirmed pivot structure from the selected higher timeframe and builds active upper and lower liquidity shelf zones.
2. Local Sweep Detection
The chart timeframe is used as the lower-timeframe layer. Local buy-side and sell-side sweeps are detected when price takes a recent pivot level and closes back through it.
3. Reaction Evaluation
The script evaluates wick reaction quality after the sweep. Stronger wick rejection or reclaim behavior produces a higher reaction quality score.
4. Stack Classification
The script checks whether the local sweep occurred near the relevant higher-timeframe shelf. If the sweep and shelf context align, the script marks an HTF Buy Stack or HTF Sell Stack. If the sweep fights the broader shelf context, it marks a Stack Conflict.
5. Visual Output
The result is displayed through HTF shelf zones, sweep markers, stack labels, right-side tags, alerts, and a compact AG Pro panel.
🗺️ How to Read the Chart
Upper HTF Liquidity Shelf = the active higher-timeframe upper liquidity reference.
Lower HTF Liquidity Shelf = the active higher-timeframe lower liquidity reference.
Buy-Side Sweep marker = price swept a local upper liquidity reference and closed back below it.
Sell-Side Sweep marker = price swept a local lower liquidity reference and closed back above it.
HTF Buy Stack label = a sell-side sweep reacted near the lower HTF shelf with enough reaction quality.
HTF Sell Stack label = a buy-side sweep reacted near the upper HTF shelf with enough reaction quality.
Stack Conflict label = the local sweep behavior is not cleanly aligned with the broader HTF shelf context.
Panel = summarizes stack state, stack score, HTF shelves, LTF sweep state, reaction quality, next context, and invalidation reference.
🚦 Signals & States
• HTF BUY STACK → sell-side liquidity was swept near the lower higher-timeframe shelf with a qualifying reaction.
• HTF SELL STACK → buy-side liquidity was swept near the upper higher-timeframe shelf with a qualifying reaction.
• STACK CONFLICT → local sweep behavior is fighting or confusing the broader shelf context.
• LOWER SHELF → price is interacting with the lower HTF shelf area, but no full stack event is active.
• UPPER SHELF → price is interacting with the upper HTF shelf area, but no full stack event is active.
• NEUTRAL → no active shelf alignment or conflict is detected.
🔔 Alerts Logic
Alerts trigger when a new major stack condition appears.
• HTF Buy Stack Alignment → a sell-side sweep aligns with the lower higher-timeframe liquidity shelf.
• HTF Sell Stack Alignment → a buy-side sweep aligns with the upper higher-timeframe liquidity shelf.
• Liquidity Stack Conflict → the local sweep direction conflicts with the broader higher-timeframe shelf context.
• HTF Liquidity Shelf Touch → price enters either active higher-timeframe shelf zone.
Alerts are attention markers, not trade instructions.
🧩 Confluence Logic
The context becomes stronger when these elements align:
• Price is near an active higher-timeframe shelf
• Local liquidity is swept
• The candle closes back through the swept level
• Wick reaction quality is strong
• The panel state and chart label agree
When these elements do not align, the script treats the context as neutral or conflicting instead of forcing a directional interpretation.
📊 When to Use
• Multi-timeframe liquidity analysis
• Swing and intraday market preparation
• Smart-money-style structure review
• Sweep and reclaim evaluation
• Context checks before interpreting local reactions
• Markets where higher-timeframe levels matter
⚠️ When NOT to Use
• Very low-liquidity symbols
• Extremely noisy lower timeframes
• Markets with unreliable wick structure
• Situations where the selected higher timeframe is not meaningful
• Assets with large gaps or inconsistent session data
• Moments when a single local candle should not be over-interpreted
🎛️ Key Inputs
• Higher Timeframe Shelf → selects the timeframe used to build the broad liquidity shelves.
• HTF Shelf Pivot Length → controls how strict the higher-timeframe shelf structure is.
• LTF Sweep Pivot Length → controls how local sweep references are detected.
• Shelf Zone Width ATR → adjusts the visual thickness of HTF shelf zones.
• Max Shelf Width % Range → caps shelf thickness relative to the distance between the upper and lower HTF shelves, keeping the visual structure clean on wide timeframes.
• Near Shelf Distance ATR → controls how close a sweep must be to a shelf to count as aligned.
• Reaction Quality Threshold → sets the minimum wick reaction required for a strong stack event.
• Stack Score Smoothing → smooths the panel score for cleaner interpretation.
• Visual settings → control shelves, equilibrium line, sweep markers, event labels, right-side tags, and font sizes.
• Show Sweep Marker Letters → adds optional BS / SS text to local sweep markers. The default publication view keeps this disabled for a cleaner chart.
• Event Label Mode → Premium labels only strong HTF stack alignments. Detailed also labels stack conflicts.
• Adaptive Label Layout → automatically shortens and separates shelf labels when higher timeframes compress the HTF shelf cluster.
• Event Label Offset ATR → moves stack event labels farther from candles and shelf-center labels. HTF Sell Stack labels are pushed above the upper shelf zone, while HTF Buy Stack labels are pushed below the lower shelf zone to reduce overlap on publication screenshots.
• Right-side tags use adaptive positioning so the STACK tag avoids crowding the HTF UPPER and HTF LOWER tags when price is near a shelf.
🖥️ Interface & Visual Design
The interface is built around a clear visual hierarchy:
HTF shelves show the broader liquidity map.
Sweep markers show local liquidity events.
Stack labels show important alignment or conflict moments.
The AG Pro panel compresses the current state into a fast, readable decision-support summary.
🧪 Practical Usage Workflow
1. Start with the panel state.
2. Check where price is relative to the HTF upper and lower shelves.
3. Look for a recent buy-side or sell-side sweep marker.
4. Read the event label only if the sweep happened near the relevant shelf.
5. Use Reaction Q and Stack Score to judge whether the context is clean or weak.
6. Interpret the result inside the broader market structure.
🔍 Interpretation Guidelines
HTF Buy Stack does not mean price must go up. It means a sell-side sweep reacted near a lower higher-timeframe shelf with enough quality to deserve attention.
HTF Sell Stack does not mean price must go down. It means a buy-side sweep reacted near an upper higher-timeframe shelf with enough quality to deserve attention.
Stack Conflict is often more useful as a warning than as a signal. It tells the trader that the local sweep and broader shelf context are not cleanly aligned.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an auto-trading system.
It does not provide guaranteed entry or exit signals.
It does not claim that every liquidity sweep will reverse.
⚠️ Limitations & Transparency
Higher-timeframe pivot shelves are confirmed after structure develops, so they are not instant future levels.
Different chart timeframes may create different local sweep readings.
Very volatile markets may generate fast shelf touches without clean reactions.
Low-liquidity symbols may produce misleading wick behavior.
The selected higher timeframe should match the trader’s actual analysis horizon.
🧠 Market Context Notes
Liquidity analysis is strongest when local behavior is interpreted inside a broader structure.
A sweep near a meaningful higher-timeframe shelf can carry more information than a random sweep in the middle of a range.
This script is designed to make that distinction visible.
🧾 Use Case Examples
When price sweeps local sell-side liquidity near the lower HTF shelf and closes back above the swept level, the script may mark HTF BUY STACK if reaction quality is strong enough.
When price sweeps local buy-side liquidity near the upper HTF shelf and closes back below the swept level, the script may mark HTF SELL STACK if reaction quality is strong enough.
When a local sweep appears away from the relevant higher-timeframe shelf, the script may classify the move as neutral or conflicting.
🧱 System Philosophy
The script follows a context-first AGPro approach:
Structure first.
Liquidity second.
Reaction third.
Decision support last.
It is designed to reduce isolated signal thinking and encourage multi-timeframe interpretation.
🔐 Non-Promise Statement
No script can guarantee outcomes.
No shelf, sweep, score, or label should be treated as certainty.
The output should always be combined with broader market context and personal risk rules.
📉 Risk Disclosure
Trading involves risk.
Markets can move against any interpretation.
This script is for educational and analytical purposes only.
Users are fully responsible for their own decisions.
📚 Educational Note
Use this script to study how lower-timeframe liquidity behavior changes when it is read against higher-timeframe structure.
Wskaźnik Pine Script®
_Neo Matrix__Neo Matrix_ is a market-state and structure reading system — built to make premium-style market structure tools freely accessible to the TradingView community.
The main idea is simple:
Core shows the market center.
Wall shows the structural defense line.
Trend Guide shows adaptive price boundaries.
Stretch Zones show expansion and exhaustion areas.
Dashboard summarizes the current state.
Neo Matrix is intended as a visual framework for reading structure, pressure, expansion, and tactical context more clearly.
The system combines several visual and contextual components:
• Neo Core
Neo Core acts as the central reference layer of the system, helping traders observe whether price is moving near, above, or below its main market center.
• Neo Wall
Neo Wall is a structural defense line designed to show the active market regime and the area where price structure is being defended.
• Trend Guide
Trend Guide is an adaptive boundary-based layer that helps visualize meaningful price displacement. Its upper and lower boundaries can be displayed to observe where price needs to move before the guide updates.
www.tradingview.com
• Stretch Zones
Stretch Zones are expansion areas around the Core. They help identify when price is moving far away from its central structure and entering a stretched condition.
www.tradingview.com
• Candle Coloring
Candle Coloring is a momentum-based visual layer that helps traders read short-term market tone directly on the candles.
www.tradingview.com
• State Dashboard
State Dashboard is a compact panel that summarizes the current market state through three simple fields:
REGIME — structural alignment between Wall and Trend Guide.
FLOW — volume-flow-based pressure reading; neutral, bullish, bearish, or stronger pressure zones.
WATCH — tactical watch state based on context and active setup areas.
www.tradingview.com
The market has its own Matrix. Neo helps you read it.
Wskaźnik Pine Script®
Hungpixi MACD Enhanced MTF with Signal Filter & Anti-SidewayDescription:
This is an enhanced multi-timeframe (MTF) MACD strategy for TradingView, built with signal filters, anti-sideway logic, and a detailed stats table. It identifies buy/sell opportunities with trend-following or counter-trend signals and provides Bybit-ready JSON alerts for automated trading.
Key Features:
Multiple signal modes: Buy Trend, Buy Counter, Sell Trend, Sell Counter, Strong Buy, Strong Sell. Toggle each signal type to suit your testing needs.
Anti-Sideway Filter: EMA 34 & 89 on 30-min chart plus ATR filter to eliminate sideways market noise.
Multi-Timeframe Analysis (MTF): Automatically calculates signals from higher timeframes and combines with current timeframe for more reliable entries.
Dynamic ATR Stop Loss: Stop-loss levels adapt to market volatility using ATR.
Visual Stats Table: Tracks Equity, Net %, Closed Trades, Win Rate, Profit, and Max Drawdown directly on the chart.
Bybit JSON Alerts: Fully formatted alerts for direct use with trading bots or alert systems.
Customizable Parameters:
- MACD Fast/Slow/Signal lengths
- Cross Score, Indicator Direction Score, Histogram Score
- ATR Stop Multiplier & Period
- EMA Periods, ATR Filter, Minimum ATR for entries
How to Use:
- Import the script into TradingView (Pine Script v6).
- Enable/disable the signal modes as needed.
- Set up JSON alerts to connect with Bybit or your trading bot.
- Monitor the stats table to evaluate strategy performance over time.
Notes:
Works on all TradingView symbols, especially crypto, forex, and stock markets. Always backtest thoroughly before trading live. Give feedback on adjustments for better performance in different markets or timeframes. Telegram contact: @hungpixi
Strategia Pine Script®
Multi-Timeframe Momentum [EXCAVO]Five-Timeframe EMA and RSI Alignment with Confluence Detection
The Multi-Timeframe Momentum reads EMA position and RSI level across five
user-configurable timeframes simultaneously, assigning a BULL, NEUT, or BEAR bias
to each. When the required number of timeframes are fully aligned in the same
direction, a confluence condition is active: candles are colored and a labeled
marker appears at the bar where alignment begins. A compact dashboard displays
each timeframe's conditions, alignment counts, and a composite momentum score.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator to the price chart. The dashboard appears in the
corner and candles begin coloring as soon as confluence conditions
are met.
Step 2 → Read the dashboard. Each row shows one timeframe: TF label, EMA
direction, RSI value, and BIAS (BULL / NEUT / BEAR). When the
alignment threshold is reached, the Bull Align or Bear Align row
highlights. The Score row shows the composite reading from -10 to +10.
Step 3 → A labeled marker below a bar marks the start of bull confluence -
the first bar where Min Confluence timeframes aligned bullish on close.
The label shows the alignment count (e.g. 4/5 or 5/5). A marker above
the bar marks the start of bear confluence. Candles remain colored
for the entire duration that confluence is active.
Step 4 → Adjust Min Confluence (default 4). At 5, all five timeframes must
agree. At 3, partial alignment is sufficient and conditions become
more frequent.
Step 5 → Set up confluence alerts to receive notifications on bar close.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ EMA Position
For each timeframe, the indicator fetches the previous closed bar's EMA(length) and
close price using request.security() with a offset and barmerge.lookahead_on.
EMA direction is bullish when close is above the EMA, bearish when close is below.
The offset and confirmed-bar gating ensure values do not change after the bar
closes.
◆ RSI Level
RSI(length) is computed on the same confirmed closed bar for each timeframe.
RSI above 50 is treated as bullish momentum; RSI below 50 is bearish. The 50 level
is used as the neutral boundary because it indicates whether average gains exceed
average losses over the lookback period.
◆ Bias Score
Each timeframe receives a score based on the combination of EMA and RSI readings:
BULL (+2) - close above EMA and RSI above 50 (both conditions bullish)
NEUT (0) - close above EMA but RSI below 50, or vice versa (conditions conflict)
BEAR (-2) - close below EMA and RSI below 50 (both conditions bearish)
A score of 0 occurs when EMA and RSI disagree, indicating an ambiguous condition on
that timeframe.
◆ Composite Score
The sum of all five timeframe scores produces a composite reading from -10 to +10.
A score of +10 means every timeframe has both EMA and RSI bullish simultaneously.
A score of 0 indicates a balanced or mixed market across all timeframes. The score
is visible in the dashboard and included in JSON alerts.
◆ Confluence Detection
Bull confluence counts how many of the five timeframes have a BULL score (+2). Bear
confluence counts BEAR scores (-2). When either count reaches or exceeds the Min
Confluence threshold, the condition is active. A confluence marker appears on the
first bar where the count hits the threshold on a confirmed close. Candles remain
colored for every bar that the confluence condition stays active.
◆ Non-Repainting
All timeframe data is sourced via request.security() with expression and
barmerge.lookahead_on. The offset reads the last fully closed bar on each
timeframe, not the forming bar. Confluence markers are drawn only after
barstate.isconfirmed, so no marker appears until the bar closes. No value changes
after a bar is confirmed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Dual Filter per Timeframe
Unlike most multi-timeframe panels that display raw RSI values or a single trend
condition, this indicator requires both EMA position and RSI direction to agree
before assigning a bullish or bearish bias. Using two independent filters produces
three distinct states per timeframe rather than two. The NEUT state explicitly
captures the case where trend and momentum disagree, making ambiguity visible in
the dashboard rather than forcing unclear conditions into bull or bear.
◆ Composite Momentum Score
Beyond counting aligned timeframes, the indicator computes a composite score that
weights each timeframe's full EMA+RSI agreement. A reading of +8 distinguishes a
strong four-timeframe alignment where both filters agree from a weaker condition
where only one filter is bullish on each timeframe. Most multi-timeframe indicators
show binary per-row state; the score aggregates across the full five-timeframe stack.
◆ Active Confluence Duration
The labeled marker at the start of a confluence period is paired with candle coloring
that persists for the entire duration confluence remains active. This makes it
immediately visible how long the current alignment has been in effect, not just when
it began.
◆ Adjustable Confluence Threshold
The Min Confluence input directly controls detection sensitivity. At 5, only full
agreement across all five timeframes triggers a condition. At 3, partial alignment is
sufficient. The threshold is explicit and adjustable rather than fixed in code.
◆ Non-Repainting Design
Each timeframe reads the previous confirmed bar's data. No value changes after the
bar closes, and no marker is drawn until barstate.isconfirmed is true. Bar coloring
reflects the current live state, but confluence markers are final once drawn.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Compact panel showing current conditions across all five timeframes:
TF - timeframe label (1m, 5m, 1H, 4H, 1D, etc.)
EMA - direction marker; blue if close is above EMA, red if below
RSI - current RSI value; blue when above 50, red when below
BIAS - BULL (both bullish), NEUT (mixed), or BEAR (both bearish)
Bull Align - count of timeframes with BULL bias; row highlights blue when threshold met
Bear Align - count of timeframes with BEAR bias; row highlights red when threshold met
Score - composite momentum reading from -10 to +10 across all five timeframes
Legend table (bottom left) explains confluence markers, bar coloring, and BIAS labels.
Both panels toggle in Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Timeframes
TF 1 - TF 5 - five configurable timeframes (defaults: 5m, 15m, 1H, 4H, D)
Engine
EMA Length - 20 bars (period for EMA bias calculation)
RSI Length - 14 bars (period for RSI calculation)
Signals
Min Confluence - 4 (minimum aligned timeframes to activate a confluence condition)
Visualization
Bull Color - default blue
Bear Color - default red
Bar Color - ON (colors candles blue during bull confluence, red during bear confluence)
Background Highlight - OFF (subtle tint when confluence is active)
Alerts
JSON Alerts - OFF (enable for bot integration)
Dashboard
Dashboard Position - Top Right
Show Dashboard - ON
Show Legend - ON
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
Bull Confluence - Min Confluence timeframes first aligned bullish on bar close
Bear Confluence - Min Confluence timeframes first aligned bearish on bar close
Confluence Signal - any confluence condition detected on bar close
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Wskaźnik Pine Script®
HTF Candles [EXCAVO]Higher Timeframe Candles in a Panel to the Right of the Chart
The HTF Candles indicator renders higher timeframe candles in a
dedicated panel to the right of all chart data. Each completed HTF candle
is drawn as a solid semi-transparent box (body) with color-matched wick
lines. The currently forming candle uses a dashed outline and updates in
real time. Nothing is drawn when the chart timeframe is equal to or higher
than the selected HTF.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator on a lower timeframe chart (e.g., 5m or
15m). The HTF panel appears to the right of all candles.
Step 2 → Default HTF is 1H. Change it in settings to match the
context you trade (4H, D, etc.).
Step 3 → Solid boxes are completed HTF candles. Blue = bullish,
red = bearish.
Step 4 → The rightmost dashed box is the currently forming HTF
candle - it updates live on every bar close.
Step 5 → Set alerts for HTF Bullish or Bearish Candle Close to be
notified when the HTF period ends.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ HTF OHLC via Built-In Resampling
The indicator uses request.security() with lookahead_off to fetch the
current HTF candle's OHLC on every bar:
= request.security(ticker, htf, )
Without lookahead, these values reflect only confirmed data up to the
current bar - no future leaking.
◆ Candle Completion Detection
A new HTF candle is detected using ta.change(time(htf_tf)). When the time
bucket changes, the previous candle is complete. At that moment:
htf_o , htf_h , htf_l , htf_c = OHLC of the completed candle
These are pushed to history arrays (up to History Count entries), and
the oldest entry is trimmed when the limit is reached.
◆ Panel Positioning
All candles are drawn to the right of the last chart bar:
x1 = bar_index + right_margin + i x (candle_width + gap)
x2 = x1 + candle_width
Positions are recalculated on every barstate.islast update. Previous
drawing objects are deleted and rebuilt each bar so the panel always
aligns with the current last bar as new data arrives.
◆ Completed Candle Rendering
Each completed candle is drawn as:
- Body: box from max(open, close) to min(open, close)
- Upper wick: line from high to body top (only if high > body top)
- Lower wick: line from body bottom to low (only if low < body bottom)
◆ Current Candle (Dashed)
The forming candle uses the same box for fill but replaces the solid
border with four dashed lines (top, bottom, left, right edges) and
dashed wick lines. The body color reflects the live direction -
bullish (blue) if close >= open, bearish (red) otherwise.
◆ Timeframe Label Pinning
The HTF label above the panel is anchored to the highest candle in the
HTF panel (not the chart's overall high). This keeps the label stable
above the panel as price moves on the underlying chart.
◆ Timeframe Guard
The indicator checks timeframe.in_seconds() < timeframe.in_seconds(htf).
If the chart timeframe is equal to or higher than the HTF, no panel is
drawn.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Panel to the Right - No Overlap
HTF candles are positioned past the last chart bar so they never cover
price action. The panel shifts automatically as new bars arrive.
◆ Dashed Forming Candle
The current unfinished HTF candle is visually distinct (dashed outline)
so it is never confused with confirmed history.
◆ Stable Timeframe Label
The HTF label is pinned to the highest candle inside the panel itself
rather than the chart's overall high. The label position stays consistent
relative to the HTF panel even when underlying chart prices spike outside
the panel range.
◆ Non-Repainting OHLC
request.security() with lookahead_off ensures that completed candle
values are final before they are committed to history. No retrospective
changes occur to completed boxes.
◆ Timeframe Guard
The indicator automatically disables itself when the chart timeframe is
greater than or equal to the selected HTF — no panel is drawn,
preventing meaningless output.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ LEGEND
Legend table (bottom left) explains the visual elements:
▮ (blue) - Bullish completed HTF candle (solid outline)
▮ (red) - Bearish completed HTF candle (solid outline)
┅ (blue) - Currently forming HTF candle (dashed outline)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
HTF Settings
HTF Timeframe - 60 (1H by default)
History Count - 5 (completed HTF candles to keep visible)
Show Current Candle - ON (show the forming candle with dashed outline)
Visualization
Bullish Color - blue (customizable)
Bearish Color - red (customizable)
Candle Width (bars) - 5 (width of each candle box)
Gap Between Candles - 2 (spacing between boxes)
Right Margin (bars) - 10 (distance from last chart bar to panel)
Dashboard
Show Legend - ON
Alert Settings
Allow Repainting - OFF
JSON Alerts - OFF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
HTF Bullish Candle Close - HTF candle closed bullish (close >= open)
HTF Bearish Candle Close - HTF candle closed bearish (close < open)
HTF Candle Close - any HTF candle closed
JSON payloads include direction, ticker, price, timeframe, htf, and indicator tag.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Wskaźnik Pine Script®
Luxy BOSS MODE - Support & ResistanceBOSS MODE S/R is a comprehensive Support & Resistance system that detects, scores, and learns from every zone reaction — then automatically generates trade plans with entry, stop, target, and position size.
Unlike traditional S/R indicators that simply draw lines, BOSS MODE combines 6 detection engines , an adaptive scoring algorithm , a real-time momentum classifier powered by the Luxy Energy Index, and a Trade Plan Generator that calculates exact risk parameters based on your account.
── WHAT MAKES IT DIFFERENT ──
1. Adaptive Weight Scoring
Every zone is scored 0-100 based on 7 factors: volume at touch, higher-timeframe origin, confluence with other zones, freshness, touch count, regime alignment, and historical performance. After 20+ observed zone outcomes (first bounce or first break per zone), the system adjusts its scoring weights based on which factors correlated with bounces vs breaks on that specific chart and asset.
2. LEI-Powered Momentum Classifier
Uses the Luxy Energy Index (Extension + Velocity + Volume exhaustion model) to classify each approaching zone as likely BOUNCE or BREAK . LEI ≥ 70 = exhausted move arriving at zone = bounce expected. LEI ≤ 30 = energized move = break risk.
3. Trade Plan Generator
For qualifying setups (Grade A/B zone, regime-aligned, R:R above your minimum), the indicator auto-calculates:
Entry — just beyond zone boundary
Stop Loss — opposite side of zone + ATR buffer
Target — nearest zone in trade direction
Position Size — based on your account size and risk %
R:R ratio — only shows when above your minimum
4. Per-Zone Intelligence
Every zone tracks its own history: how many times it bounced vs broke, average bounce distance in ATR units, and hold rate. Labels show this inline: ⬆ SUPPORT 📐 82 5/7 +0.4ᴬ = score 82, held 5 of 7 tests, avg distance from zone mid at touch: 0.4 ATR.
── 6 DETECTION ENGINES ──
📐 Swing Pivots — Classical swing highs/lows on current, Daily, and Weekly timeframes
🧱 Order Blocks — Last candle before a strong impulsive move, confirmed by volume
📊 Volume POC — Highest-volume price cluster over lookback period
💨 Fair Value Gaps — 3-candle imbalances where price left unfilled ranges
💧 Liquidity Pools — Equal high/low clusters where stops accumulate
⚓ Anchored VWAP — Auto-anchors on gap+volume events (earnings, catalysts)
All 6 sources feed into the same unified zone object, allowing true confluence scoring across methodologies.
── REGIME-AWARE SCORING ──
The market regime (STRONG_BULL / WEAK_BULL / RANGE / WEAK_BEAR / STRONG_BEAR / SQUEEZE) drives the scoring bias. In a bullish regime, support zones receive a significant score bonus while resistance zones score lower — reflecting the statistical reality that zones aligned with the trend hold more reliably.
Regime is calculated from ADX + Bollinger Band Width + EMA slope, giving 5 states plus a Squeeze override when volatility compresses to the bottom 10% of the last 100 bars.
── VISUAL SYSTEM ──
Zones are rendered with a 4-layer heat-map system:
Atmospheric halo — fades beyond zone boundaries, scales with score
Main fill — neon color: cyan family for support, red/orange for resistance, intensity proportional to score
Hot core strip — brighter inner band at zone midpoint
Entry line — solid bright stripe at the price-contact edge (top for support, bottom for resistance)
Grade-A pulse ring — glowing outline when a high-conviction zone is within 1.5 ATR of price
Score bar — vertical progress bar to the right of each zone, height = score 0-100
Simple View : A separate layer draws just two clear boxes — nearest SUPPORT (green) and nearest RESISTANCE (red) — with text centered inside. Designed for traders who want instant visual clarity without analyzing all zones.
── TRADE PLAN GENERATOR ──
Configure in the 💰 Trade Plan settings group:
Account Size ($) — your total trading capital
Risk per Trade (%) — standard is 1.0% per trade
Min R:R to Show — only displays setups where the calculated reward exceeds this multiple of risk
When a qualifying setup is found, three dashed lines appear on the chart (blue = entry, red = stop, green = target) with a summary label showing direction, prices, share count, and R:R ratio. The Dashboard shows it in the 💰 Active Setup row. An alert fires with the full trade plan.
Important: The Trade Plan Generator identifies setups based on zone proximity and regime alignment. All trade decisions remain entirely the responsibility of the user. Past zone reactions do not guarantee future performance. Always apply your own analysis and risk management.
── DASHBOARD (14 rows) ──
The information panel shows in real-time:
Market Regime with color coding
Asset Class / Session (PRE/RTH/AH for stocks)
Active zones breakdown (0A/1B/3C format)
Nearest Resistance price, grade, ATR distance
Nearest Support price, grade, ATR distance
ATR% Rank (volatility context)
Active Warning (8 types, color-coded by severity)
Anchored VWAP value and anchor reason
Squeeze detector
Zone Hit Rate (historical bounce %)
Active Detection Sources
Scenario suggestion
Adaptive Weights status
Active Trade Plan (Entry / Stop / Target / Shares / R:R)
Every cell has a detailed tooltip explaining what the value means and how to use it.
── MULTI-ASSET SUPPORT ──
The asset engine auto-detects chart type and adjusts accordingly:
Stocks — ATR-based zones, session-aware (PRE/RTH/AH)
Stocks under $1 — percent-based zone widths (ATR is unreliable for extreme low-price securities)
Crypto — 24/7, percent bands, no session breaks
Forex — pip-based zone widths
Indices — volume-agnostic fallback
Futures — rollover-aware
── SETTINGS OVERVIEW ──
🎯 Trading Mode — Scalp / Intraday / Swing (affects zone widths and sensitivity)
🧭 Regime Classifier — ADX, BB, and EMA periods
🎯 Zone Detection — Toggle each of the 6 engines independently
📐 Swing Pivots — Left/right lookback bars and zone width
🧱 Order Blocks — Lookback period, minimum move %, volume threshold
📊 Volume POC — Lookback bars and histogram bins
💨 Fair Value Gaps — Minimum gap size %
💧 Liquidity Pools — Lookback and touch tolerance %
⚓ Anchored VWAP — Auto-anchor thresholds and manual catalyst date
⚖️ Scoring — Individual weight controls for all 7 scoring factors
🌍 Asset-Class Adaptation — Override or force Sub-$5 mode
🚨 Warnings — Toggle each of 8 warning types with ATR distance control
🎨 Visual Settings — Top-N zones, adaptive hide, transparency, Simple View toggle
📊 Dashboard — Position, size, show/hide
💰 Trade Plan — Account size, risk %, minimum R:R
🔔 Alerts — Standard or structured JSON for webhook automation
── ALERTS ──
8 alert types:
Any Warning (catch-all)
Sweep Imminent
Regime Shift near Grade-A zone
Trap Suspected (low-volume false breakout)
Zone Approach
Squeeze Detected
Trade Plan — LONG Setup
Trade Plan — SHORT Setup
Enable Structured JSON Alerts to receive webhook-ready payloads with full zone data, regime, warning type, and trade plan details.
── EXTERNAL LIBRARY ──
This script imports Luxy Energy Index (LEI) by OrenLuxy for the momentum classifier. LEI measures move exhaustion using Extension from VWAP, Velocity (5-bar rate of change), and Volume as a modifier.
── IMPORTANT NOTES ──
This indicator is for educational and analytical purposes only . It does not constitute financial advice.
Past zone performance (hit rate, average bounce) does not guarantee future results.
The Trade Plan Generator calculates position sizes mathematically based on user inputs — always verify sizing with your broker before placing orders.
Adaptive weights require 20+ observed bounce/break events to activate. On new charts, base weights are used.
The LEI library requires separate import — the indicator will prompt if not accessible.
── CREDITS ──
Luxy Energy Index (LEI) — OrenLuxy. Exhaustion methodology drawing on academic research by Campbell-Grossman-Wang (1993) on volume-return relationships, ATR normalization by J. Welles Wilder Jr., and standard VWAP methodology.
S/R concepts inspired by VSA (Volume Spread Analysis), SMC (Smart Money Concepts), and classical pivot point theory.
Past performance does not predict future results. This tool is for informational purposes only and does not constitute investment advice. Trading involves substantial risk of loss.
Wskaźnik Pine Script®
Minicharts Pro+ [Herman]Minicharts Pro+
Minicharts Pro+ is a multi-timeframe visualization tool designed to display higher timeframe price action directly on your current chart.
The script renders multiple compact “mini charts” representing selected timeframes, allowing users to observe structure, candle behavior, and relative positioning without switching between charts.
It is intended for traders who want to maintain awareness of higher timeframe context while working on a lower timeframe, without interrupting their workflow.
Purpose
The main purpose of this tool is to improve chart workflow and situational awareness by:
Providing a clear overview of multiple timeframes in one place
Reducing the need to switch between charts
Helping users visually align lower timeframe activity with higher timeframe structure
This script is designed as a visual analysis aid and can be used alongside any trading methodology.
How it works
The indicator uses request.security() to retrieve OHLC data from selected timeframes and reconstructs them as miniature charts displayed on the right side of the screen.
Each mini chart:
Displays historical candles from the selected timeframe
Is scaled dynamically based on recent price range and volatility
Is rendered independently to preserve clarity of structure
The layout is organized in a grid format, where each panel represents a different timeframe.
Users can adjust positioning, spacing, and sizing to fit their chart preferences.
Moving Averages & VWAP
Each mini chart includes optional overlays for additional visual context:
EMA (Exponential Moving Average)
VWAP (Volume Weighted Average Price)
These can be enabled or disabled individually for each mini chart, allowing flexible customization depending on user preference.
Both EMA and VWAP are calculated using standard methods based on the selected timeframe data and are displayed purely for reference.
SMT (Intermarket Comparison)
The script includes an optional SMT-style comparison feature between correlated instruments.
By default, the script automatically selects a related symbol (e.g., NQ ↔ ES, GC ↔ SI)
Users can manually override the symbol if needed
Pivot-based comparisons are used to highlight differences in swing highs and lows between instruments
This feature provides a visual way to compare price behavior between instruments and is based solely on historical price data.
HTF FVG Visualization
Optional higher timeframe imbalance (FVG) zones can be displayed within each mini chart.
Both standard and inverted FVG structures are supported
Users can choose between extended zones or next-bar-only display
Only the most recent inverted FVG is highlighted to reduce visual clutter
These zones are derived from candle relationships within the selected timeframe and are provided for visual reference only.
Inputs & Customization
The script provides multiple configuration options to adapt to different workflows:
Minicharts Setup
Up to 6 independent timeframes
Enable/disable each mini chart
Optional SMT overlay per timeframe
Individual EMA and VWAP toggles per mini chart
SMT Configuration
Automatic or manual symbol selection
Pivot lookback setting
Custom colors for high/low comparisons
HTF FVG Configuration
Enable/disable FVG display
Extension mode selection
Custom colors for bullish, bearish, and inverted zones
Style & Layout
Number of candles displayed per mini chart
Spacing and positioning
Chart size and grid layout
Candle colors and background frames
Timeframe label visibility
Notes
This script is designed for visualization purposes only
It does not generate trading signals, alerts, or recommendations
All calculations are based on historical price data
The tool is intended to support chart analysis, not replace independent decision-making
Wskaźnik Pine Script®
ICT Smart Money Footprint [AGPro Series]ICT Smart Money Footprint
🔷 OVERVIEW
ICT Smart Money Footprint is a multi-timeframe price action engine that maps institutional liquidity behavior directly onto your chart. It combines higher-timeframe reaction zones (BSL/SSL) derived from swing pivots with candle-by-candle lower-timeframe footprint states — Liquidity Grab, Displacement, and Reclaim — into one cohesive visualization. A live panel tracks session bias, daily event counts, and zone lifecycle, giving price action traders a complete context window for ICT-style analysis across every timeframe.
🧭 UNIQUE EDGE
Most Smart Money Concept indicators plot every swing as a zone, producing cluttered charts that obscure the very structure they aim to reveal. This tool takes a different route. It separates the question "where is liquidity?" (answered at HTF with wide, contextual zones) from "what is price doing right now?" (answered at LTF with footprint labels). The two layers communicate through a single panel and a shared color palette, so the trader always sees both the macro landscape and the tactical footprint without layering multiple scripts. Priority filtering ensures only the highest-conviction event is printed per bar, and confluence windowing prevents label clustering.
⚙️ METHODOLOGY
The script runs two parallel engines.
The HTF Zone Engine pulls pivot highs and lows from a higher timeframe using request.security with lookahead disabled. Each confirmed pivot anchors a reaction zone sized by HTF ATR × 1.5, ensuring natural visibility on any chart view. Buy-Side Liquidity (BSL) zones form above price at pivot highs; Sell-Side Liquidity (SSL) zones form below price at pivot lows. Zones extend right via line.new with extend.right and a linefill between the two edges. When price tags a zone, the zone is marked mitigated: its lines switch to dashed style, width drops, color fades, and right extension freezes at the touch point.
The LTF Footprint Engine evaluates each confirmed candle for three events. Liquidity Grab triggers when price sweeps the prior LTF swing with a buffer and closes back inside range in the opposite direction. Displacement triggers when candle range exceeds ATR × multiplier and the candle breaks the prior bar's extreme. Reclaim triggers when price recovers a recently lost swing level within a 20-bar window. A priority filter (DISP > LG > REC) prints only the strongest event per bar and direction. A session bias score accumulates these events and resets daily, tinting the chart background and updating the panel in real time.
📡 SIGNALS & ALERTS
Six alert conditions are built in:
• Liquidity Grab (bull or bear)
• Displacement (bull or bear)
• HTF Mitigation (any zone tagged)
• Reclaim (bull or bear)
• Bias Turned Bullish
• Bias Turned Bearish
All alerts include ticker and interval placeholders for multi-chart monitoring.
🎛️ KEY INPUTS
HTF Source — Auto scales the higher timeframe to your chart (15m→4H, 1H→D, 4H→W, 1D→M), or pick a manual HTF.
HTF Pivot Length — controls strength threshold of liquidity zones.
HTF Zone Height (ATR x) — default 1.5; tune for wider or tighter zones.
LTF Pivot Length — swing sensitivity for LG and REC detection.
Displacement ATR Multiplier — default 2.0; raise for only the most explosive candles.
Sweep Buffer — extra cushion above or below swing levels for LG qualification.
Confluence Window — suppresses back-to-back same-direction labels.
Session Bias Band — subtle background tint reflecting daily event accumulation.
Panel Location, Theme, Font Size — full control over on-chart presentation.
🧩 HOW TO USE
Start with your normal trading timeframe. The HTF Source set to Auto will anchor the zones to a relevant higher timeframe. Watch how price interacts with the BSL and SSL zones: unmitigated HTF zones act as liquidity targets and reaction areas, while mitigated (dashed) zones mark where liquidity has already been absorbed.
Use the LTF footprint labels to read the tactical story inside those zones. A Liquidity Grab near an SSL zone hints at institutional accumulation. A Displacement candle after an LG often precedes a structural shift. A Reclaim of a recently lost level signals inducement and potential continuation. The panel's Session Bias gives you a running directional read; when it flips, an alert can fire.
Traders typically combine this tool with their own execution framework: HTF zones for bias and target selection, LTF footprints for timing and confirmation. The indicator provides the map; risk management, entry rules, and position sizing remain the trader's responsibility.
⚠️ LIMITATIONS & TRANSPARENCY
This indicator is an analytical mapping tool, not a trading strategy. It identifies structural patterns and plots them for visual analysis.
HTF zones rely on request.security with lookahead disabled, which means new zones appear only after the HTF pivot is fully confirmed — this introduces a natural lag consistent with non-repainting practice but means some reactions may occur before the zone is drawn.
LTF footprint labels are confirmed on bar close. Intrabar signals during live bars may flicker until the bar closes.
Different market conditions produce different zone densities. Ranging markets generate more mitigated zones; trending markets leave more unmitigated zones above or below price. Use the Max Active Zones input to cap chart clutter.
Past structural patterns do not guarantee future outcomes. Liquidity sweeps can mark reversals or simply precede continuation moves. Always validate signals with your own analysis and broader market context.
📌 RISK DISCLOSURE
This script is provided for educational and analytical purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any asset. Trading involves substantial risk of loss. Past performance does not guarantee future results. Users are solely responsible for their trading decisions, risk management, and position sizing. The author assumes no liability for any outcome arising from the use of this indicator.
Wskaźnik Pine Script®
Trend Quality [AGPro Series]Trend Quality
Trend Quality fuses three independent regime dimensions — ADX directional strength, Kaufman Efficiency Ratio, and ATR-normalized EMA slope — into a single 0–100 composite Trend Quality Score. A hysteresis + confirmation + cooldown gate turns that score into a stable TREND / CHOP regime, enhanced with HTF confirmation, lifecycle phases, score velocity, breakout grading, directional dominance, and a full adaptive on-chart quality window. The goal is simple: replace noisy "is this a trend?" guessing with a transparent, multi-dimensional, low-lag quality reading you can read in one glance.
🎯 OVERVIEW
Most trend filters fail at the same thing — they tell you a trend exists, but not whether that trend is clean, accelerating, fading, or already exhausted. Trend Quality answers the harder question. Every bar is scored on three independent dimensions that each measure a different physical property of price movement:
• ADX — directional strength (how strongly one side dominates)
• Kaufman Efficiency Ratio (ER) — path efficiency (how little wasted motion)
• ATR-normalized EMA slope — normalized trend velocity (how fast, relative to volatility)
These three signals are combined into one 0–100 Trend Quality Score. A hysteresis band + confirmation bars + cooldown filter convert that score into a stable TREND / CHOP regime — no single-bar flipping, no false recovery wicks. On top of the core regime, the indicator layers Score Velocity, Lifecycle phases (Emerging → Confirmed → Exhausting), Breakout Quality grading (A / B / C), directional dominance, and a visual Quality Window that tracks the active trend zone and projects it forward.
💎 UNIQUE EDGE
What separates Trend Quality from a standard ADX filter, an EMA slope indicator, or a generic regime meter:
• Tri-factor fusion (not a single metric) — ADX alone misses path quality; ER alone misses direction; slope alone misses choppy-but-strong moves. Weighted fusion (45% ADX, 35% ER, 20% Slope) neutralizes each component's blind spot.
• Stable regime, not a flickering line — the TREND / CHOP state passes through a 3-layer filter: hysteresis band around the threshold, N confirmation bars, and a cooldown window after every transition. The result is a regime reading that holds through pullbacks without flipping.
• Score Velocity Engine — a second-derivative layer that watches how fast the score itself is changing. Surges flag momentum ignition; collapses flag quality breakdown before price confirms it. A bearish divergence detector fires when price makes new highs while quality is fading.
• Lifecycle phases — inside every TREND regime, the script distinguishes Emerging (young, fresh, accelerating), Confirmed (mature, stable, above buffer), and Exhausting (score rolling over from a peak). This lets you see whether you are entering early, running mid-trend, or catching the end.
• Breakout Quality Badge (A / B / C) — every CHOP → TREND transition receives a graded badge based on composite score plus velocity bonus. Grade A breakouts are rare and have an optional dedicated alert.
• HTF confirmation with Auto-HTF mapping — the same engine runs on a higher timeframe. When LTF is trending but HTF is not, the regime is marked BLOCKED (not forced to CHOP) so you retain full transparency about why the regime is gated.
• Adaptive Quality Window — a live rectangular zone that tracks the full trend's high/low from its start bar, projects forward, shows ceiling/floor projection labels, and preserves historical windows with directional color coding (green for up-trends, pink for down-trends, amber for HTF-blocked trends).
🧪 METHODOLOGY
Core composite score (every bar, LTF):
Score = 100 × (0.45 × ADX_norm + 0.35 × ER_norm + 0.20 × Slope_norm)
• ADX_norm = min(ADX / 50, 1)
• ER_norm = |close − close | / (SMA(|Δclose|, N) × N)
• Slope_norm = min(|EMA − EMA | / ATR × 10, 1)
Regime gating:
• Hysteresis: +3 above threshold to enter TREND, −3 below to enter CHOP
• Confirmation: N consecutive bars above/below the hysteresis band
• Cooldown: N bars after every regime flip where no new flip is allowed
MTF confirmation (optional, default ON):
The same core function is called via request.security on the HTF (Auto: 30m→4H, 4H→Daily, Daily→Weekly, Weekly→Monthly in Strict mode). When LTF=TREND but HTF=CHOP, the regime is tagged BLOCKED — a transparent third state that is neither forced-CHOP nor accepted-TREND.
Lifecycle logic:
• Emerging: TREND is young (bars since start ≤ Emerging Bars) OR score slope ≥ 0 and score below buffer
• Confirmed: score ≥ threshold + Confirmed Buffer AND HTF passes (optional)
• Exhausting: score slope < 0 AND pullback from peak ≥ Exhaustion Pullback
Score velocity:
velocity = score − score (default 5-bar look-back)
Breakout quality grading:
bqScore = score + velocity_bonus (bonus: +15 if vel>15, +7 if vel>5, else 0)
A ≥ 82, B ≥ 67, C < 67
🔔 SIGNALS & ALERTS
The script exposes 12 alert conditions — all moderator-safe, educational, non-solicitating:
• CHOP → TREND / TREND → CHOP regime flips with LTF+HTF context
• Strong Trend composite conviction threshold
• HTF Blocked / HTF Unblocked third-state transparency events
• Emerging / Confirmed / Exhausting Trend lifecycle phase changes
• Velocity Surge / Velocity Collapse second-derivative extremes
• Grade-A Breakout rare high-conviction breakouts
• Bearish Divergence price up, quality down warning
On-chart visual events (also filterable via inputs):
• Breakout Quality badge (A / B / C) at every CHOP → TREND
• Bearish divergence ⚠ marker at trend peaks where quality fades
• State tag near backbone: EMERGING / CONFIRMED / EXHAUSTING / HTF BLOCKED
• Quality Window label: ACTIVE + phase
• Projection labels on the right edge: QUALITY CEILING / TREND FLOOR
All badge and warning labels are gated with an 8-bar cooldown so the chart stays clean even on repeated intra-swing triggers.
⚙️ KEY INPUTS
Core engine:
• ADX Length (14) — directional strength look-back
• Efficiency Length (20) — ER path-efficiency window
• Slope EMA Length (50) — trend backbone reference
• ATR Length (14) — volatility normalization
• TREND Threshold (55) — composite score level to enter TREND
• Confirmation Bars (1) — bars of persistence before flipping
• Strong Trend Offset (15) — extra score above threshold for STRONG tag
MTF:
• HTF Confirmation (ON) — enable/disable HTF gate
• Auto HTF (ON, Strict) — smart HTF mapping per chart TF
• Manual HTF (240) — override timeframe
Stability:
• Change Cooldown Bars (2) — lock-out window after any regime flip
Lifecycle:
• Emerging Phase Bars (4) — max trend age to stay Emerging
• Confirmed Buffer (8.0) — score must clear threshold+buffer
• Exhaustion Pullback (4.0) — peak-to-current drop to flag Exhausting
Visual Overlay:
• Backbone + Glow + Zone + State Candles + Quality Window + Historical Windows + Projection Box + Guides + Midline (all toggleable)
Panel, Theme, Layout, Help rows, Alerts, Score Velocity Engine, Breakout Quality Badge, Divergence Detector — every layer has its own input group and can be shown/hidden independently.
📘 HOW TO USE
Read-in-one-glance panel (standard AGPro format):
• Blue header row: script title
• Line 2: REGIME / LIFECYCLE · Score N/100 · Velocity state
• Line 3: LTF regime · Direction · Directional Dominance
• Line 4: HTF regime · MTF PASS/BLOCKED · Active Window state · Streak
Quick playbook:
1. CHOP on LTF → wait. No setup, no commitment.
2. CHOP → TREND transition with Grade A badge + HTF PASS → highest-conviction regime start.
3. CONFIRMED phase with DOM HIGH and rising score → the middle of the trend, usually the cleanest section.
4. Velocity COLLAPSE or EXHAUSTING phase with bearish divergence ⚠ → quality is deteriorating; reduce exposure or tighten stops.
5. HTF BLOCKED amber window → LTF trend exists but higher timeframe disagrees; treat as lower-conviction and be aware of mean-reversion risk.
The indicator does NOT issue buy/sell signals, does NOT define entry/exit prices, and is NOT a strategy. It is a regime-quality reading — a context layer you pair with your own trade management.
⚠️ LIMITATIONS & TRANSPARENCY
• Trend-quality indicators are inherently trend-following. In low-volatility ranges the score can stay above threshold on minor moves; in very fast markets the score can lag by 1–3 bars while the filters stabilize.
• HTF confirmation introduces a natural HTF delay. This is intentional (it removes noise) but means the HTF gate may lift several LTF bars after price has already moved.
• All composite signals rely on look-backs (ADX 14, ER 20, Slope EMA 50, ATR 14). On very short intraday timeframes with low bar counts these need calibration.
• Lifecycle phases are structural readings, not predictions. EXHAUSTING means the score is rolling over — not that price must reverse.
• Past performance of any visual regime does not imply future performance. Charts showing clean historical windows are illustrative of the indicator's logic, not trading results.
• No repainting on historical bars. The HTF call uses lookahead_off and barmerge.gaps_off. Score and regime values on closed bars are final.
🛡️ RISK DISCLOSURE
This script is published as an educational and analytical tool. It does not provide financial advice, does not generate trade signals of any kind, and must not be used as a standalone decision system. Markets involve substantial risk of loss. Past behavior of any market regime, indicator output, or historical visual window is no guarantee of future results. Always combine any indicator with independent risk management, position sizing, a tested plan, and — where appropriate — the guidance of a licensed professional. You are solely responsible for any trading decisions you make.
Wskaźnik Pine Script®
Auto Trendlines MTF - Break/Retest [AGPro Series]Auto Trendlines MTF - Break/Retest
🔹 OVERVIEW
Auto Trendlines MTF - Break/Retest is a multi-timeframe trendline visualization engine that automatically detects and draws the most structurally significant trendlines across three complementary scales: Micro (current timeframe), Meso (intermediate pivots), and Mega (HTF weekly/monthly overlay). Instead of relying on a single pivot scan, the engine builds a ranked candidate pool from each scale and selects the lines that best represent the active market structure around current price.
The script is designed as a pure analytical visualization tool — it does not generate trading decisions, forecasts, or directional recommendations. Its purpose is to give the chart a clean, hand-drawn-quality trendline layer that updates automatically as new pivots form.
🎯 UNIQUE EDGE
Most auto-trendline tools scan one timeframe and draw whatever fits. This engine operates differently in four specific ways:
• Three-scale MTF engine. Micro pivots on the current TF, Meso pivots with wider sensitivity, and Mega trendlines derived from Weekly/Monthly HTF pivots are computed independently and rendered together with a visual hierarchy (Mega dominant, Meso intermediate, Micro active).
• Log-space geometry. All trendline math runs in log-price space, so long-dated diagonals on volatile assets (crypto, growth stocks) do not distort visually when the chart is viewed in logarithmic mode.
• Touch-weighted ranking with violation penalty. Each candidate line is scored by touch count, line age, slope sanity, price proximity, and intra-line violations. Weak geometry, over-sloped lines, and frequently violated lines are demoted automatically.
• Q quality score (0–100) and confluence tags (x2/x3). Every drawn line carries a Q score that blends touches, freshness, geometry, relevance, and violations into a single number. Confluence tags surface when a Micro line and a Meso line sit within the same ATR band near price, highlighting multi-scale structure overlap.
🧠 METHODOLOGY
1. Pivot detection. Separate pivot streams are maintained for Micro (tight sensitivity), Meso (wider sensitivity), and Mega (HTF pivots via request.security).
2. Candidate generation. For each scale, the engine pairs anchor pivots with subsequent pivots to form line candidates, discards over-sloped ones, and computes touches, violations, and break status in log space.
3. Ranking. Candidates are scored by a weighted combination of touch count, time span, slope sanity, relevance to current price (distance in ATR), and violation count. The best non-duplicate lines are kept per scale.
4. Clutter guards. A minimum ATR separation rule prevents near-duplicate lines from stacking. Smart Focus hides far-from-price lines in Minimal/Balanced density modes to keep the chart readable.
5. Stability mode. In Locked mode, selected lines persist bar-to-bar and are only replaced when they break or fall out of the candidate pool — reducing visual repainting on lower TFs.
6. Break/Retest detection. Once a line is drawn, the engine tracks close-based breaks (with configurable tolerance) and subsequent retests within a time window, emitting labeled signals on TF ≤ 1D.
⚙️ SIGNALS & ALERTS
Break and retest events are plotted for each scale with short ASCII tags:
• µR / µS = Micro Resistance / Support break
• mR / mS = Meso Resistance / Support break
• MR / MS = Mega Resistance / Support break
• rµ / rm / rM = retest on Micro / Meso / Mega respectively
A dedicated alertcondition is exposed for every break and retest event, plus two aggregate alerts (Any BR, Any RT) for users who prefer a single alert stream. A Min Q filter lets the user suppress low-quality signals.
🛠️ KEY INPUTS
• Profile Mode. Auto by Timeframe or Manual (Clean Trader, Balanced, Analyst, Presentation, Custom).
• Density Override. Minimal, Balanced, or Bold visual density.
• Line Weight Override. UltraThin, Thin, or Normal.
• Labels / Signals / Stability / Broken-line behavior. All individually overridable.
• Mega Overlay. Full (lines + cloud + label), Lines Only, or Off.
• Advanced panels. Micro Engine, Meso Engine, Mega Engine, Ranking, Visuals, and Signals each expose their own fine-tuning controls for experienced users.
• HUD. Position, theme (Classic Gray, Premium Accent, Color Coded, Showcase), and text size.
📘 HOW TO USE
• Add the script to any liquid symbol and start on a 1H or 4H chart.
• Leave Profile Mode on "Auto by Timeframe" for a balanced default that adapts to the active TF.
• Read the HUD in the top-right corner to see the active profile, how many Micro/Meso lines are drawn, whether Mega is active, and current Q scores.
• When a line carries a Q score above ~65 and a Conf tag (x2 or x3) appears nearby, that zone is a multi-scale structural pocket — use it as a planning reference, not as a trade trigger on its own.
• Use the Break/Retest tags for situational awareness around drawn lines; combine with your own confirmation logic before acting.
⚠️ LIMITATIONS & TRANSPARENCY
• Lines are drawn from historical pivots and can only confirm after a pivot is established. The engine avoids repainting in Locked mode but cannot predict future pivots.
• Q scores and confluence tags describe structural quality, not directional probability. A high-Q line can still break.
• Mega lines depend on HTF pivot availability; on very young symbols or thin charts, Mega may fall back to a Macro-pivot source or remain hidden.
• The script is published as Public, Open Source so that every ranking rule, weight, and threshold is fully auditable in the source code.
🛡️ RISK DISCLOSURE
This script is a visualization and analysis tool only. It is not financial advice, not a trading strategy, and not a signal service. No performance claims are made or implied. Past structural behavior of trendlines does not guarantee future behavior. All trading decisions, risk sizing, and execution remain the sole responsibility of the user.
Wskaźnik Pine Script®
Cross-Timeframe Value Overlay [AGPro Series]Cross-Timeframe Value Overlay
🔷 Overview
Cross-Timeframe Value Overlay projects up to three independent rolling value
bands — one per selected higher timeframe — onto a single chart. Each band
marks the region where price has been accepted on that timeframe over a
configurable lookback window, built from a volume-weighted or mean-based
anchor surrounded by an ATR envelope. A built-in state engine then classifies
the relationship between bands in real time as ALIGNED, OVERLAP, CONFLICT or
NEUTRAL, so multi-timeframe context becomes readable in a single glance.
🔷 What Makes This Different
Most multi-timeframe scripts stack indicators or draw fixed HTF pivots. This
tool builds a *rolling* value envelope on each timeframe and then compares
them structurally rather than numerically.
• Three independent MTF value bands on one chart, each with its own lookback
context and ATR-sized width.
• Dedicated state engine with four discrete regimes — ALIGNED / OVERLAP /
CONFLICT / NEUTRAL — based on pairwise band geometry, not on raw price.
• Dynamic z-order rendering that automatically draws the slowest timeframe
behind faster ones, and an opacity hierarchy that keeps the slowest band
lightest and the fastest band darkest. Larger structures frame smaller
ones instead of obscuring them.
• Rank-based label placement that prevents collisions when bands overlap in
price, so labels remain readable even during OVERLAP or ALIGNED states.
• Box width adaptively capped so a Daily band cannot swallow a 1H chart.
• Dominant-TF tracking that always reports the highest enabled timeframe and
the price position relative to its band.
🔷 Methodology
For each enabled timeframe the script computes:
• Anchor = VWAP (volume-weighted HLC3) over the rolling window, or HLC3 SMA
when volume data is unreliable.
• Half = ATR(window) multiplied by the configured band-width factor.
• Band = .
Values are requested with lookahead disabled, so historical band positions
reflect only data that was available at the time.
The state engine then evaluates:
• Pairwise overlap — do any two bands share a price region?
• Alignment — are all enabled band centers clustered within a strictness
threshold (Loose 1.2 ATR / Standard 0.8 ATR / Strict 0.4 ATR) of their
mean?
• Disjoint count — how many pairs are fully separated?
These three checks map deterministically to one of four states on every bar.
🔷 Signals and Alerts
Three built-in alert conditions cover the most useful MTF transitions:
• Value Overlap Detected — a new pairwise overlap forms between any two
enabled timeframes.
• Higher-Timeframe Value Lost — price leaves the dominant HTF value band
after being inside it on the previous bar.
• Cross-Timeframe Conflict — the state engine transitions into CONFLICT,
indicating that at least one enabled pair of bands has become fully
disjoint.
All alerts are wired as alertcondition() entries so they can be combined
with the standard TradingView alert workflow.
🔷 Key Inputs
• Timeframes — enable/disable up to three HTFs and pick any resolution for
each (defaults 1H / 4H / Daily).
• Rolling Window — 10 to 500 bars for the anchor and ATR.
• Band Width — 0.25 to 3.0 ATR half-width.
• Anchor Method — VWAP + ATR or HLC3 MA + ATR.
• Alignment Strictness — Loose, Standard or Strict threshold for the state
engine.
• Show Only Overlapping Bands — hides isolated bands to keep confluence
zones visible.
• Visuals — per-TF color, base opacity, right-edge label toggle, label font
size.
• Panel — position, font size and master visibility switch.
🔷 How to Use
• Read the state first. ALIGNED = all enabled timeframes agree on a common
value region; OVERLAP = partial confluence; CONFLICT = disjoint
timeframes; NEUTRAL = fewer than two active bands or indeterminate.
• Read the Dominant row to see which timeframe currently carries the most
structural weight.
• Read the per-TF rows to locate price as Above / Inside / Below each band.
• Combine the three in a single pass: for example, price Above a dominant
HTF band while the state is CONFLICT is a very different context from
price Inside an ALIGNED stack.
• Pair with your existing entry framework (breakout, mean-reversion, order
flow, trend-following) — this tool is a context layer, not an entry
signal generator.
🔷 Limitations and Transparency
• Box-based rendering is capped at three concurrent bands by design to keep
the chart readable.
• All values are computed with lookahead disabled. Bands update when the
corresponding HTF bar closes, which is the expected behavior for any MTF
tool.
• Volume-weighted anchoring depends on the quality of the instrument's
volume feed; on markets with unreliable volume, switch to the HLC3 MA
method.
• This script is an analytical overlay. It is not a strategy, does not
produce buy/sell signals, and makes no forecasting claim.
🔷 Risk Disclosure
Trading involves substantial risk. This indicator is provided for research
and educational purposes only and does not constitute financial advice.
Past market behavior does not guarantee future results. Always perform your
own due diligence and use proper risk management.
Open-source under Mozilla Public License 2.0.
Wskaźnik Pine Script®
MTF Trend Agreement Map [AGPro Series]MTF Trend Agreement Map
🔹 **Overview**
MTF Trend Agreement Map is a multi-timeframe alignment engine that reads the trend across five timeframes at once and distills the result into a single transparent agreement score. Instead of forcing you to flip between charts, the map tells you, on every bar, how many timeframes agree, which side wins, and whether the market is in a locked regime, a forming trend, or a conflict phase. It is built for swing traders, HTF-bias scalpers, position traders, and anyone who uses top-down analysis as part of their process.
🔸 **What Makes It Different**
Most MTF indicators show a single method (usually a moving-average cross) repeated across timeframes, which means five rows that all agree with each other by construction. This map does something different: for each timeframe it runs three independent methods — an EMA regime filter, a pivot-based market-structure read (HH/HL vs LH/LL), and a normalized momentum slope — and blends their individual votes into the final score. You see not only the agreement across timeframes but also the agreement across methods, which exposes weak or borderline regimes that a single-method tool would quietly hide.
🔺 **Methodology**
• EMA Trend: a timeframe is bullish when EMA50 is above EMA200 and price is above EMA50; bearish on the mirror condition; neutral otherwise.
• Market Structure: confirmed pivots are tracked in real time. A timeframe is bullish while the last two confirmed swings form higher highs and higher lows, bearish on lower highs and lower lows.
• Momentum Slope: the change in linear regression across a configurable lookback, normalized by ATR so that fast and slow assets are comparable.
• Consensus per timeframe: each active method casts a vote; bulls minus bears determines the row's net direction and strength.
• Overall alignment: bull and bear votes are summed across all active timeframes; the dominant side's share defines the agreement percentage.
◆ **Three-State Regime Engine**
• **LOCKED** — agreement above the strong threshold (default 80%). High-conviction regime, continuation-friendly, background tint activates.
• **TRENDING** — agreement between 50% and the strong threshold. Directional bias forming but not yet fully aligned. Trade with reduced size or wait for confirmation.
• **SPLIT** — agreement below 50%. Timeframes are in conflict, no majority side. Classic chop phase, favors mean-reversion strategies or standing aside.
🔔 **Signals & Alerts**
• Regime Lock (Bull or Bear): fires the first bar agreement crosses above the strong threshold while one side dominates. Designed as a continuation trigger, not a reversal signal.
• Chop / Conflict: fires when no side holds the majority, a classic filter for mean-reversion systems or a stand-aside cue for trend traders.
• Both generic and directional alertcondition() hooks are exposed so you can wire the map into automations.
⚙️ **Key Inputs**
• Core Engine: toggle any of the three methods on or off, and tune the pivot length and momentum lookback independently.
• Timeframes: four user-selected timeframes plus an optional Current row that auto-adapts to the chart TF. If the chart TF matches any selected TF, the Current row is hidden automatically to avoid double-counting.
• Panel: six location presets, four text sizes (default Normal), dark or light theme, optional per-method breakdown row.
• Background Tint: enable or disable, set the strong-alignment threshold (50–95%) and control transparency (70–99) to keep the chart premium.
📖 **How to Use**
• Top-down confirmation: take trades on your execution timeframe only when the higher rows in the map agree with your thesis.
• Regime filter: enable Regime Lock alerts to catch moments when the full map snaps into alignment — these are typical continuation windows.
• Conflict filter: when the map prints SPLIT, widen stops, reduce size, or step aside; trend strategies historically underperform during these phases.
• Method debugging: turn on the per-method breakdown to see which methods are driving the score and which are fighting it.
⚠️ **Limitations & Transparency**
• All timeframe values are non-repainting at bar close (lookahead is disabled), but intrabar values can update until the parent bar closes — this is expected MTF behavior.
• Market Structure requires enough history on each timeframe to confirm two swings; on very young assets or short charts the structure vote may be neutral until pivots print.
• The map is a context tool, not a standalone entry system — combine it with your own execution logic, risk management, and bias.
📌 **Risk Disclosure**
This script is provided for educational and analytical purposes only. It does not constitute financial advice, a recommendation, or a solicitation to trade any instrument. Markets involve substantial risk and past behavior does not guarantee future results. Always do your own research and manage risk responsibly.
Wskaźnik Pine Script®






















