Aurora_Channel_V1█ Overview
The Aurora Channel is an adaptive multi-layer volatility and expansion framework that fuses Bollinger Bands, Keltner Channels, volume-sensitive dynamics, and intelligent moving-average selection into a single coherent system.
Instead of treating channels as static statistical boundaries, Aurora continuously evaluates market behavior, selects the most suitable moving-average engine in real time, expands or contracts outer envelopes according to volume and width regimes, and projects dynamic trigger and crossover levels that respond to actual price action.
The result is a hybrid channel system that blends:
• Adaptive MA selection (Auto / Adaptive Scoring)
• Volume-modulated Keltner expansion
• Hybrid Bollinger–Keltner “Aurora” bands
• Multi-layer expansion envelopes
• Peak-aware or dynamically tracking Trigger Channel
• Crossover Multiplier Engine with adaptive overlays
• Regime-aware visuals and a live Dashboard HUD
█ Why is this one unique
Most channel indicators are fixed formulas. Aurora is a full adaptive channel engine built in Pine Script v6.
It does not simply plot Bollinger or Keltner bands. It constructs a hybrid core, surrounds it with volume-aware expansion logic, maintains intelligent outer triggers, and generates dynamic crossover projection lines whose multiplier is itself adaptive.
⚪ What it does
At a high level:
Auto MA Selection Engine
Continuously scores SMA, EMA, RMA (SMMA), WMA, and VWMA candidates using a combined lag-error + jitter penalty. The engine automatically selects the MA with the lowest overall score (or lets the user force a manual choice). This becomes the center line for every subsequent calculation.
Hybrid Aurora Core
Builds classic Bollinger Bands and a volume-sensitive Keltner Channel around the selected midline. The Keltner multiplier dynamically expands between 3.0–4.0 during volume spikes. The difference between the two outer bands is then smoothed and re-applied, creating the final Aurora Upper / Lower bands.
Expansion Envelope
Measures the current Aurora width, smooths it, and projects outer envelope levels that react to both width expansion and tick-volume intensity. Optional “Breakouts Only” mode shows the envelope solely when price is already expanding beyond the Aurora bands.
Trigger Channel
Two memory modes:
• Dynamic Tracking – continuously follows expansion and decays when price returns inside.
• Hold Peak Level – latches the highest/lowest expansion extremes.
A proportional buffer is then added, creating clean outer trigger lines.
Crossover Multiplier Engine
Monitors crosses of a user-selected target (Midline, Aurora Bands, Envelope, or Trigger). On every cross it captures the current Keltner multiplier × volume ratio, latches that value, smooths it with the same adaptive MA engine, and projects symmetric overlay lines around the midline. These act as adaptive reaction / target levels.
Multi-Layer Clouds + Regime Visuals
Soft gradient fills between midline → Aurora and Aurora → Envelope, plus a softer fill toward the Trigger. Candles are colored by regime (above/below midline). A compact Dashboard HUD displays the active MA, cross target, current multiplier, expansion state, and regime.
⚪ Why it is good
The strongest aspect is the combination of adaptive center selection, volume-aware expansion, and quality-aware outer structures in one coherent framework.
Most channel tools are either pure statistical (Bollinger) or pure volatility (Keltner/ATR). Aurora merges both, then adds intelligent memory (Trigger modes) and a live crossover-driven multiplier engine. The visual hierarchy (multi-layer clouds) makes regime and expansion instantly readable, while the Dashboard keeps the key adaptive values visible without cluttering the chart.
⚪ What makes it sophisticated
• Real-time adaptive MA scoring with lag + jitter penalty
• Dynamic Keltner multiplier driven by volume ratio
• Hybrid band construction that re-injects smoothed BB–KC difference
• Dual-mode Trigger memory (peak hold vs continuous tracking + decay)
• Crossover-triggered multiplier latching and adaptive projection
• Multi-layer gradient fills that scale with the actual channel hierarchy
• Non-repainting alerts on confirmed crosses
⚪ Why It’s Marketable
Traders looking for more than a simple Bollinger or Keltner band receive a complete adaptive channel ecosystem. The Auto MA engine removes the endless debate of “which MA is best,” the Expansion Envelope and Trigger Channel give clear breakout and reaction zones, and the Crossover Multiplier Engine turns every significant cross into dynamic, volume-aware target lines. The result is a selective, visually rich, and highly configurable system that adapts to the instrument and timeframe instead of forcing a fixed formula onto every market.
⚪ Main weakness
The system is still rule-based adaptive logic, not deep learning. Performance depends on the chosen lengths, the quality of volume data (especially on tick-volume charts), and the current market regime. Over-optimization of the many parameters can reduce robustness.
█ How It Works
⚪ Auto MA Selection Engine
Scores five classic moving averages on tracking error (squared lag) plus a jitter penalty. The lowest combined score becomes the active center line used by every channel component.
⚪ Aurora Core Construction
• Midline = selected MA
• Bollinger = midline ± StdDev × multiplier
• Keltner = midline ± ATR × volume-modulated multiplier (3.0–4.0)
• Aurora bands = Keltner ± smoothed (BB – KC) difference
⚪ Expansion Envelope
Average Aurora width is multiplied by a base factor and further expanded by excess volume. The resulting offset is added outside the Aurora bands. Optional breakout-only plotting keeps the chart clean until genuine expansion occurs.
⚪ Trigger Channel
On expansion the system either latches the extreme (Hold Peak) or follows and slowly decays the level (Dynamic Tracking). A proportional buffer creates the final trigger lines.
⚪ Crossover Multiplier Engine
Detects crosses of the chosen target, captures kcMult × volRatio, latches the value, smooths it with the adaptive MA engine, and projects midline ± ATR × smoothed multiplier as dotted overlay lines.
█ How To Use
• Use the Aurora bands as the primary dynamic support/resistance zone.
• Watch the Expansion Envelope for genuine volatility breakouts.
• Treat the Trigger Channel as outer reaction / invalidation levels.
• The Crossover Multiplier lines act as adaptive targets or reaction zones after significant crosses.
• Candle color and the Dashboard HUD give instant regime and state information.
• Enable alerts on the crossover condition for automated notifications.
█ Settings
Auto MA Selection Engine
• MA Selection Engine (Auto Adaptive / Manual)
• Manual MA type
• Jitter Penalty strength
Core Channel Engine
• Base Center Length
• Bollinger StdDev multiplier
• Keltner ATR Length
• Tick Volume MA Length & Expansion Factor
• Band Difference MA Length
Expansion Envelope
• Show / Breakouts Only
• Expansion MA Length
• Envelope Base Multiplier & Volume Boost
Trigger Channel
• Show Trigger
• Buffer Multiplier
• Memory Mode (Dynamic Tracking / Hold Peak Level)
Crossover Multiplier Engine
• Show Dynamic Lines
• Cross Monitoring Target
• Multiplier MA Smoothing Length
Visual Settings
• Candle Coloring
• Multi-Layer Cloud
• Dashboard HUD
• Full color customization for every layer
█ Disclaimer
The content provided in this script is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. Past performance is not indicative of future results. All trading involves risk, and you are solely responsible for your own trading decisions. Индикатор

Crypto Correlation Dashboard [StrixEDGE]Overview
A real-time Pearson correlation matrix built for crypto portfolio analysis. Tracks the statistical co-movement between up to 6 assets across selectable timeframes, using log-return correlation — not raw price correlation — to avoid the inflated readings that plague most correlation tools.
Whether you're managing a multi-asset portfolio, hunting pairs trades, or monitoring regime shifts, this dashboard tells you exactly when diversification is real and when it's an illusion.
🔍 What Makes This Different
Most correlation indicators on TradingView calculate Pearson r on raw closing prices. That's a statistical mistake: two assets trending upward will always show near-perfect correlation on price, even if their returns are completely independent. This indicator correlates **logarithmic returns**, which isolates actual co-movement from shared trend bias.
The multi-timeframe engine uses a period-scaling method through `request.security` that preserves mathematical accuracy when projecting higher-timeframe correlations onto lower-timeframe charts — consuming only 6 security calls total, leaving headroom for other indicators on your layout.
⚡ Key Features
6×6 Correlation Matrix
Full heatmap-style matrix covering all 15 unique pair combinations (C(6,2)). Color intensity maps directly to correlation strength: teal for strong positive, red for strong negative, neutral gray for uncorrelated pairs. Diagonal cells are blanked — no wasted space showing you that BTC correlates with BTC.
Multi-Timeframe Support
Select from Chart / 1H / 4H / 1D / 1W directly in settings. The lookback period auto-scales to the target timeframe resolution, so "20 periods on Daily" means 20 trading days regardless of your chart timeframe.
Rolling Correlation Chart
Select any pair (Leg A / Leg B) and track its correlation coefficient over time as a continuous line. Shaded fill between the line and zero gives an instant visual read of direction and magnitude. A dynamic label on the last bar displays the current ρ value.
Aggregate Statistics Bar
Footer row shows AVG / MIN / MAX across all 15 pairs at a glance. When the minimum correlation drops to or below your threshold, a ⚠ BREAKDOWN tag appears.
Three Independent Alert Conditions
- Pair Breakdown — fires when any single pair falls to or below your threshold
- Average Breakdown — fires when the market-wide average correlation collapses
- Rolling Crossunder — fires when your selected pair crosses under the threshold
📐 How to Use
Portfolio Diversification Check
Add your held assets as Symbols 1–6. If the matrix is mostly dark teal (all pairs > 0.7), your portfolio moves as a single block — you're concentrated, not diversified. Look for pairs with low or negative correlation to add genuine hedging value.
Regime Change Detection
Monitor the AVG stat in the footer. A sudden drop in average correlation often precedes volatility expansion, sector rotation, or flight-to-quality moves. The average breakdown alert automates this surveillance.
Pairs Trading
Identify pairs with historically high correlation (> 0.8). When their rolling correlation temporarily collapses, it may signal a mean-reversion opportunity. Use the rolling chart to time entries and the crossunder alert for notifications.
Risk Management
During market stress, correlations tend to spike toward 1.0 across the board ("correlation breakdown to the upside"). When the matrix turns uniformly teal, portfolio risk is higher than position sizing alone suggests.
⚙️ Settings
| Parameter | Default | Description |
|---|---|---|
| Symbols 1–6 | BTC, ETH, SOL, BNB, XRP, ADA | Any tradable asset — crypto, forex, equities, commodities |
| Lookback Period | 20 | Number of target-TF bars for Pearson calculation |
| Timeframe | Chart | Correlation resolution: Chart / 1H / 4H / 1D / 1W |
| Breakdown Alert ≤ | 0.30 | Threshold for all three alert conditions |
| Rolling Pair | 1 × 2 | Which pair (by index) to plot on the rolling chart |
| Matrix Position | Top Right | Table placement on the pane |
| Colors | Brand defaults | Full control over positive, negative, neutral, header, and accent colors |
🧠 Technical Notes
- Log returns `ln(close / close )` are used instead of simple returns for better statistical properties (additivity, normality approximation).
- TF scaling: When the selected timeframe exceeds the chart timeframe, the lookback is multiplied by the bar ratio. Pearson r is invariant under uniform observation duplication, so accuracy is preserved.
- Security calls: 6 total (one per symbol), well within Pine's 40-call limit.
- Symbol parsing: Automatically strips exchange prefixes (Binance, Bybit, Coinbase, OKX, etc.) and quote currencies (USDT, USD, BUSD, USDC) for clean matrix labels.
- Works on any asset class — not limited to crypto despite the default symbols.
⚠️ Limitations
- Selecting a timeframe **lower** than your chart TF (e.g., "1H" on a Daily chart) will not produce hourly-resolution correlation. The multiplier floors at 1 and you get chart-TF correlation. For true 1H correlation, view on a 1H chart.
- Pearson correlation measures **linear** relationships. Non-linear dependencies (tail risk, asymmetric co-movement during crashes) require different tools.
- Past correlation does not guarantee future correlation. Regime shifts can invalidate historical readings without warning — which is exactly why the breakdown alerts exist. Индикатор

STP Top 10 Trade Opportunity Scanner / ScreenerSTP Top 10 Trade Opportunity Scanner / Screener
The STP Top 10 Large Move Radar is a multi-symbol market scanner designed to help traders quickly identify stocks showing conditions that may support a larger-than-normal price move.
Instead of reviewing charts individually, the Radar continuously analyzes up to 20 user-selected symbols and ranks the strongest opportunities based on a proprietary scoring system. The highest-ranked symbols are displayed in an easy-to-read Top 10 table.
The system evaluates multiple technical factors, including price trend, EMA alignment, VWAP positioning, RSI, DMI/ADX, buying and selling pressure, Range Oscillator conditions, relative volume, ATR, volatility expansion, squeeze and compression conditions, breakouts and breakdowns, supply and demand proximity, Fair Value Gaps, price movement speed, and overall trend strength.
Radar Table Information
Each ranked symbol includes:
Score: Overall opportunity score from 0–100 based on the combined technical conditions evaluated by the Radar.
Direction: Identifies the current directional bias as BULL, BEAR, or NEUTRAL.
Setup: Identifies conditions such as BREAKOUT, BREAKDOWN, SQZ RELEASE, COMPRESSED, AT S/D, AT FVG, NEAR BREAK, or BUILDING.
RVOL: Measures current volume relative to average volume to identify unusually active symbols.
ATR: Displays the previous completed daily 10-period ATR in dollars to provide context for the symbol's typical daily movement.
ATR Used: During regular market hours, estimates how much of the symbol's daily ATR has been used so far. Before and after the regular session, the Radar identifies the applicable market session instead.
Speed: Measures the magnitude of short-term EMA movement relative to ATR.
T-Strength: Classifies directional trend conditions as Strong, Moderate, Weak, or None.
Evidence: Highlights supporting technical conditions including squeeze activity, breakouts, supply/demand proximity, and Fair Value Gaps.
How Traders Can Use the Radar:
The Radar is designed primarily as an opportunity-discovery tool. A high ranking does not automatically represent a trade entry. Instead, traders can use the Top 10 list to identify which symbols deserve further chart analysis.
For example, a high-scoring bullish symbol showing elevated relative volume, a breakout or squeeze release, increasing speed, and strong trend conditions may warrant closer review for a potential bullish setup. The opposite conditions may identify potential bearish opportunities.
The Radar can be used alongside the STP Elite Prediction System or a trader's existing technical analysis process to confirm chart structure, support and resistance, risk, entry timing, and trade direction before entering a position.
Customizable Symbol List:
Users can configure up to 20 symbols, allowing the Radar to monitor a personal watchlist of stocks, ETFs, or other supported TradingView symbols. The scan timeframe is also configurable, with the default set to 5 minutes.
Dynamic Alerts:
The Radar includes a dynamic alert system for the highest-ranked opportunity. Users can set a minimum score threshold and optionally receive alerts when the leading symbol changes, its direction changes, or it crosses the configured threshold. Alerts include the symbol, direction, opportunity score, relative volume, ATR Used status, and scan timeframe.
Important:
The STP Top 10 Large Move Radar is intended to identify and rank developing technical conditions. Rankings and scores can change as new market data becomes available. A high score does not guarantee a large move and should not be considered a standalone buy or sell signal.
This indicator is intended for educational and informational purposes only and does not constitute financial advice. Индикатор

Precision PushBack [MohaveTrader]WHAT PUSHBACK IS
PushBack is a support-and-resistance overlay whose levels are built from a dual Williams %R engine, paired with a rail-based trend layer that runs on its own detection. Where the source oscillator treats a %R extreme as exhaustion — a spent move likely to reverse — PushBack reads that same condition as sustained directional pressure: the side in control pushing price to an extreme.
Two terms carry the whole design. Every completed pressure run is an EVENT. An event that clears qualification earns a LEVEL. Events that do not qualify are marked, but no level is built. When an event does qualify, PushBack takes the price extreme reached by that push and stamps it as a structural zone, then carries that zone through its own lifecycle of resistance, support, reclaim and testing. The panel counts both, so how selective the current settings are running on this instrument is readable at a glance.
It is intended for traders who want structure that emerges from qualifying pressure events rather than levels drawn on a fixed schedule, with a separate trend read layered on the same chart.
WHAT'S ORIGINAL
PushBack retains the dual fast and slow %R detection from upslidedown's open-source "%R Trend Exhaustion" (credited below and in the source code) and uses it only as the raw event source. Everything built on top is original: the reinterpretation of the extreme as directional pressure; event qualification by price range and, when enabled, sustained duration; the Event Mode presets that set how selective that qualification is; event-derived zone geometry, where a zone's depth is taken from the run's own candles; the support and resistance lifecycle with reclaim and testing states; role-flip management and retirement; ATR relevance hiding; optional same-state merging; the live run ribbon; the candle coloring modes; the trend layer with its fast and structure rails, defended-level state machine and rail-assisted transitions; and the information panel. The following image illustrates upslidedown's "%R Trend Exhaustion," the open-source indicator PushBack's detection comes from. Each filled box is one %R run — red where both fast and slow %R are overbought, blue where both are oversold — with a triangle where the run ended. PushBack reads these same runs as pressure rather than exhaustion, and keeps the price extreme each one reached as a structural level. For comparison the second image renders PushBack and %R Trend Exhaustion on the same chart.
WHAT MAKES IT DIFFERENT
The structure is emergent, not scheduled. No structural zone is created without a completed qualifying pressure run, so the absence of nearby zones is itself information rather than a missing calculation.
Structure and events are kept separate. The zones are the structural layer and carry the role-based color set. The pressure marks and run ribbon are a distinct event layer in a single neutral color, held off the price and clear of the zones, so a mark is never mistaken for a directional signal.
The run ribbon reads live. It sketches in real time across the pressure run and settles into the completion triangle, so a developing run is visible on price as it happens rather than only after it ends.
The trend line is the rail, not a separate object. The plotted line is the fast adaptive rail itself rather than an average derived from it, so the drawn line and the value the engine reads are the same series and cannot disagree.
%R PRESSURE
Pressure is read from a dual fast and slow Williams %R with independent smoothing. Both periods and the threshold are fixed internally at settled values rather than exposed as inputs. A shared threshold defines the overbought condition (bullish pressure) and the oversold condition (bearish pressure), and a run is the span in which that condition holds. The single event PushBack acts on is the run's completion — the bar the condition is lost.
Not every run qualifies. A completed run must clear a size test — its price range as a multiple of ATR — and, when duration filtering is on, a duration test as well: it must have persisted for the required number of bars. Both conditions must be met, and a larger or faster move does not waive the duration requirement. An Event Mode control — Responsive, Balanced, Strict, or Manual — sets how demanding that qualification is; in Manual, the Advanced values are read instead and the duration test can be turned off to gate on range alone. The duration test is not scaled by timeframe.
ZONES
When a qualifying run completes, its price extreme seeds a zone: a bullish pressure run's high becomes resistance, a bearish pressure run's low becomes support — the rail where the push stalled. Zone depth is set at birth from the run's own candles: the mean or the median of the run's bar ranges, median by default so a single outlier bar does not distort the level. Neither method applies a multiplier, so depth comes from the same bars that produced the level and there is no width setting to tune. Depth is frozen at birth. An optional merge step, off by default, can consolidate same-state zones that overlap or fall within a configurable price gap; with it off, distinct qualified levels stay separate.
A level holds until price closes through it. A close through flips it to a reclaim, which can firm back into support or resistance as price tests and holds. Red is resistance, green is support, cyan is reclaim, yellow is testing. A level keeps flipping between roles until it reaches its Max Role Flips limit — three by default — after which it is retired rather than reclaimed again; fresh pressure re-seeds it if it matters again.
Zones persist as structural objects and can change role as price interacts with them. A zone originally created as support or resistance may later become reclaim, enter testing, and resolve back into support or resistance. Its displayed color and label represent its current state, not necessarily the state in which it originated.
Previously established zones can remain stored after the pressure event that created them has passed. A zone outside the configured ATR relevance distance is hidden rather than deleted and can reappear when price returns. Because a zone can persist through multiple state changes, a currently visible zone may have originated much earlier, in a different role, and its original completion mark may no longer be visible on the chart. A fresh reclaim is held visible for a short grace period regardless of distance. A per-side cap limits the number of native support and resistance zones retained; reclaim zones are exempt from that cap.
PRESSURE MARKS AND RUN RIBBON
A triangle marks where each run completed — a down triangle where a bullish run ended, an up triangle where a bearish run ended. The run ribbon traces the run into that completion, one bar short of the triangle. Both use a single neutral color and float off the price in ATR-scaled offset space, so side is read from triangle direction and ribbon position rather than color. They show the duration and completion of a pressure run and are not buy or sell signals. By default every completed run is marked with a triangle. A qualified event also carries a ribbon into its triangle and seeds a zone; a filtered turn — one that did not clear qualification — is marked identically but with no ribbon and no zone, so the triangle shows that an event occurred while the ribbon and zone show whether it earned a level. Show All Event Marks turns the filtered triangles on or off.
TREND LAYER
A second engine runs alongside the zones, with its own dual %R detection independent of the one above. Its pressure runs do not create zones; they set rails. A completed bullish run leaves a lower rail at its low, a completed bearish run leaves an upper rail at its high, and one of those rails is held as the defended level that owns the current trend state. A close beyond the defended level flips the campaign, but only when an opposing rail exists and price has cleared it; otherwise the campaign continues.
Two adaptive followers of the body-weighted midpoint support that state machine. The fast rail shortens its own averaging length as a bar's body sits further from it, so a displaced bar moves it most of the way in one bar. The structure rail uses the same formula with a longer base and sits inside a hysteresis channel scaled to a long-period ATR, so its direction holds through ordinary pullbacks and only turns when price crosses the far edge of that channel.
Between them these supply two transitions the defended level alone cannot make. Once a bullish event has set a campaign ceiling, a failure of the fast rail can end the campaign early at that ceiling. In the other direction, both rails turning up together can start a bullish campaign with no completed %R event at all. These rail-assisted transitions print a diamond alongside the flip triangle so they are distinguishable from a defended-level flip. A campaign entered by the rails alone carries no defended level and exits late by construction.
The plotted trend line is the fast rail, drawn in the campaign color rather than the rail's own direction, so the line's shape comes from the follower and its color from the campaign. An optional two-tier fill runs from price to the fast rail and from the fast rail out to the structure rail, each tier colored by its own source, so a disagreement between the two renders as a two-tone band. Optional sequence marks compare each completed rail event's extreme to the previous event on the same side and print HH, LH, HL or LL; these are instrumentation only and drive nothing.
CANDLE COLORS
Candles can optionally be recolored, in one of two modes.
Pressure mode carries the bar's own direction as hue and whether a %R pressure run is active as brightness, so a bearish bar inside a buying-pressure run stays a bright bearish candle and a developing push is visible on the candles themselves.
Wave mode drops bar direction and paints the campaign instead, reusing the trend line's own two colors so the candles and the line always agree. Three independent sources are then readable at once on the same bars: campaign state sets the candle's hue, an active %R pressure run sets its brightness, and the inner fill follows the fast rail's own direction. Because the fill is the only one of the three tied to the fast rail, a pullback inside a campaign renders as candle color standing against fill color, while an actual campaign flip changes the candles themselves. That is the distinction Wave exists to make. Wave draws nothing before the first campaign is established, since no trend state exists yet to color.
Both modes dim between pressure runs and brighten during them. This uses plotcandle, so native candles should be hidden in chart settings to avoid overlap. Turned off, it draws nothing and leaves the native candles untouched.
INFO PANEL
An optional corner panel reports three rows. RSI is colored relative to the current campaign rather than against fixed bands, since RSI ranges differently in an advance than in a decline; the color meaning is constant — one color when buyers hold RSI control, another when sellers do, and a neutral shade in between — while the bands themselves shift with the campaign. EVENTS counts every completed pressure run for the session. LEVELS counts how many of those earned structure, with the percentage being that earned share. That percentage largely reflects how demanding the current Event Mode is rather than a property of the instrument, so it reads as feedback on whether the mode suits what is being traded: a very low share suggests qualification is tighter than the instrument supports, and a very high one suggests it is filtering little. The panel frame carries the RSI color so the state reads from across the screen. The session count can include extended hours or regular hours only.
ALERTS
Two alert conditions are provided, one for a qualified bullish pressure event and one for a qualified bearish pressure event. Alerts fire only when a completed run clears PushBack's active qualification requirements and earns structure; filtered event marks do not alert. The trend layer does not carry its own alerts.
HOW TO READ IT
Read the zones as structure and the marks as events: every triangle is an event, and only the ones carrying a ribbon and a zone earned a level. PushBack keeps four things distinct: the pressure event is where a zone came from; price interaction is what has since happened to it; the current color and label are what the level means now; and ATR relevance decides whether it is shown at all. A currently visible zone may have originated much earlier, in a different role, than the state now displayed. Treat a blank area as the absence of currently relevant qualifying pressure structure, not a missing calculation. Use the live ribbon to watch a qualifying run develop. The completion triangle identifies where a pressure run ended; when that completion also qualifies, its ribbon remains, a structural zone is established, and the corresponding alert can fire.
The two layers are independent and can disagree. The zones and the trend campaign are computed from separate detections and neither gates the other, so a level forming against the prevailing campaign is a normal reading rather than a conflict to resolve.
LIMITATIONS
A zone is not created until its run completes, so the level is confirmed after the move that produced it, not during. The %R condition can persist for a long time in a strong trend, so a run's duration is not itself a timing signal. PushBack is most expressive on instruments that produce qualifying pressure events and is quiet on orderly price.
The trend layer's rail events carry no qualification of their own, so a very short pressure run can set a rail. Because two of its transitions are driven by the rails rather than by a completed event, the campaign can change direction with no %R event involved, and a campaign entered that way holds no defended level. Zone role changes are driven by subsequent price interaction, so a zone's displayed state reflects the bar being evaluated and changes as price develops. On very low-priced instruments a run whose bar ranges are near the minimum tick can produce a zone thin enough to render as a line rather than a band.
PushBack does not predict future prices, does not manage risk, and does not guarantee any outcome.
ATTRIBUTION AND LICENSE
PushBack's dual-period Williams %R detection is derived from the open-source "%R Trend Exhaustion" indicator by upslidedown, who is credited here and in the source code. That indicator reads the %R extreme as exhaustion; PushBack uses the same detection only as a raw event source and reinterprets the extreme as sustained directional pressure. The pressure-event qualification, the persistent zone construction and event-derived geometry, the support and resistance interpretation, the reclaim and testing lifecycle, flip management and retirement, relevance behavior, merging, the run ribbon, the candle coloring modes, the trend layer and its rails and transitions, and the price-overlay presentation are original to PushBack. PushBack is published open-source under the Mozilla Public License 2.0.
DISCLAIMER
PushBack's zones, marks and trend state are analytical structures derived from the rules described above, not recommendations to buy or sell any instrument. You remain solely responsible for every trading decision. Индикатор

Volatility Regime Engine [TRADION]Volatility Regime Engine is a multi-layer market regime analysis framework designed to identify changes in volatility structure, expansion/compression cycles, directional pressure, and continuation quality.
Rather than treating volatility as a single measurement, the engine evaluates multiple dimensions of market behavior to determine whether price is transitioning into compression, expansion, continuation, exhaustion, or a potentially unstable regime.
The objective is not simply to detect high or low volatility, but to identify how volatility is evolving, whether directional participation supports the move, and whether the current regime has sufficient quality to persist.
CORE ARCHITECTURE
The engine combines several analytical components into a unified regime model:
Volatility Regime
Evaluates the current volatility environment and classifies market conditions according to contraction and expansion behavior.
Fast & Confirmed Scores
Two-stage scoring separates early regime detection from confirmed conditions.
The Fast Score reacts more quickly to developing volatility changes, while the Confirmed Score provides a more stable assessment of established conditions.
This architecture is designed to balance responsiveness with confirmation.
ATR Regime
Measures volatility behavior relative to the instrument's recent range structure, helping distinguish subdued conditions from elevated or extreme volatility environments.
Bandwidth Analysis
Tracks contraction and expansion in the underlying price distribution to identify volatility compression and developing expansion phases.
Relative Volume (RVOL)
Provides participation context by comparing current activity with its historical baseline.
Directional & Setup Bias
Evaluates whether the developing volatility structure favors bullish or bearish conditions.
Bull and Bear Setup Scores quantify the relative strength of each side, while Dominance summarizes the resulting directional imbalance.
Cycle Engine
The Cycle Bias and Cycle State components classify the current phase of the volatility cycle.
Possible conditions include developing ignition, expansion, continuation and exhaustion phases.
This allows the indicator to distinguish between a market that is merely volatile and one that may be entering a structured directional expansion.
Ignition Detection
Ignition logic searches for early evidence that volatility is beginning to transition from a dormant or compressed state into directional expansion.
Bull Ignition and Bear Ignition events are designed as regime-transition signals, not standalone trade entries.
Release Quality
When volatility begins to release, the engine evaluates the quality of that transition.
Release Quality, Quality Grade and Follow Through help determine whether an expansion is developing sufficient structural confirmation or losing momentum.
Macro Continuation
Continuation logic reduces repetitive signaling once a directional regime has already been established.
This allows the engine to distinguish between:
initial ignition,
confirmed release,
established continuation,
and potential exhaustion.
Higher-Timeframe Context
Higher-timeframe regime information is incorporated into the scoring architecture to determine whether the active regime is supported or opposed by broader volatility conditions.
The HTF Quality Modifier adjusts regime quality according to this alignment.
False Expansion Risk
Not every volatility expansion develops into a sustainable move.
The False Expansion Risk model evaluates contextual conditions that may indicate a weak or unstable expansion and classifies the risk accordingly.
This component is intended to provide an additional layer of caution when volatility increases without sufficient structural support.
VISUAL ENGINE
The lower oscillator provides a compact visualization of regime behavior.
Histogram structure represents changes in volatility state and regime intensity, while the accompanying momentum structure helps visualize directional pressure and developing transitions.
Background regime zones provide additional context for compression, expansion and directional phases.
Event markers highlight significant transitions such as:
BULL IGNITION
Potential bullish volatility ignition.
BEAR IGNITION
Potential bearish volatility ignition.
BULL RELEASE
Bullish expansion gaining confirmation.
BEAR RELEASE
Bearish expansion gaining confirmation.
EXHAUST
Potential exhaustion of an extended volatility phase.
Continuation states are intentionally filtered to reduce unnecessary signal repetition.
DASHBOARD
The integrated dashboard provides a real-time summary of the engine, including:
Regime
Fast Score
Confirmed Score
ATR Regime
Bandwidth State
RVOL
Direction
Setup Bias
Bull / Bear Setup
Dominance
Breakout Memory
Cycle Bias
Cycle State
Ignition Score
Macro Continuation
Release Quality
Quality Grade
Follow Through
HTF Regime
HTF Quality Modifier
Risk Adjustment
False Expansion Risk
Active Event
The dashboard is designed to provide a compact overview of the current volatility environment without requiring interpretation of every individual component.
HOW TO USE
Volatility Regime Engine is designed primarily as a market-context and regime-analysis tool.
It can be used to:
identify volatility compression before potential expansion,
detect early bullish or bearish ignition,
evaluate the quality of developing volatility releases,
distinguish expansion from established continuation,
identify potential exhaustion conditions,
compare directional setup strength,
evaluate higher-timeframe regime alignment,
and assess the risk of unstable or false expansion.
The indicator should not be interpreted as a mechanical buy/sell system. Signals represent changes in volatility structure and should be evaluated together with price action, market structure, trend context, support/resistance and appropriate risk management.
NON-REPAINTING DESIGN
The engine is designed around confirmed-bar calculations for signal generation. Historical signals are not intentionally repositioned after confirmation.
Higher-timeframe information is handled with confirmation-oriented logic to minimize look-ahead bias.
IMPORTANT
Volatility expansion does not necessarily imply bullish price movement. Expansion can occur in either direction.
The primary purpose of the engine is to determine when the volatility environment is changing, which side currently has structural dominance, and whether that transition has sufficient quality to develop into continuation.
Volatility Regime Engine is intended for technical analysis, research and educational purposes only. It does not constitute financial or investment advice. Индикатор

Trinity ATR LevelsTrinity ATR Levels
Is an open-source overlay that draws volatility levels from the previous period close and a period ATR, then adds a session-aware signal layer on top of those levels.
Credit
The level map is a derivative of Saty ATR Levels by satymahajan, published open-source on TradingView in 2022.
Original:
What this script keeps from Saty:
Previous period close as the anchor
Trigger at a user-set share of ATR (default 0.236)
38.2, 50, 61.8, 78.6, ±1 ATR, and the same extension stack
Day / Multiday / Swing / Position / Long-term period selector
Optional "Use Current Close" switch
8-21-34 ribbon used only to color the small range/ATR info table
What this script adds:
Three modes that change when a signal may fire, not the level math
Confirmed-close ENTER and EXIT through the trigger
Golden Gate open at 38.2 percent, with 61.8 percent as the gate target
Optional pullback markers: trigger pullback (T-PB) and 10-minute EMA8
Optional first-hour previous-close reclaim on 10-minute closes
Session clock for regular hours, premarket, or 24-hour markets
Entry budget, cooldown, debounce, gap-safe open, and an optional entry buffer that does not move the stop
A dashboard that states location, action, targets, stop, and why nothing is firing
Historical percentages that appear only on the exact sample they were measured on
Alerts for the mechanical events above
This is not a republish of Saty ATR Levels with new colors. The ruler is Saty's. The traffic lights, session clock, and scoped percentages are new. Source is open so both parts can be inspected.
What the levels are
Every line is the chosen period's reference close plus or minus a fraction of that period's ATR.
PDC — previous period close. The anchor. Nothing is measured from live price unless you turn "Use Current Close" on.
Call / Put trigger — default 23.6 percent of ATR either side of PDC. A confirmed close through this line is the entry gate. A confirmed close back through it is the exit.
38.2 percent — the Golden Gate opens.
50 percent — midpoint of the gate. The script treats fresh entries here as poor reward versus the stop at the trigger.
61.8 percent — the gate target. Scale out is the intended action.
78.6 percent and ±1 ATR — extension and full-range lines. Rare on a single day. The script does not treat them as add-on zones.
Leave "Use Current Close" OFF for trading. When it is ON, the forming close becomes the anchor, the levels drift with price, the trigger boxes cannot arm correctly, and none of the historical percentages apply. The only intended use is a last-minutes preview of the next period's map. Note the numbers, then switch it back OFF.
The three modes
The levels are the same in every mode. Mode only changes signal timing, re-entry policy, and whether percentages print.
MILKMAN — default. Day period forced. Regular-hours previous close and ATR. Signals only on a 3-minute chart during regular hours. One long and one short trigger entry per session. No entry buffer. Three-bar cooldown after an exit. Percentages print only when the chart is SPY or SPX, 3-minute, Day period, regular session. That is the only configuration those figures were compiled for. On any other symbol they hide.
UNIVERSAL — same structure on any market and timeframe. Signals on every bar. Unlimited re-entries with a longer cooldown. 1 percent ATR entry buffer. Percentages hidden everywhere. They were not measured outside SPY regular hours, so the script does not show SPY numbers on other markets.
CUSTOM — every control under "Signal Rules" applies. Use this only when you know which rule you are changing and why.
How a signal is taken
A wick does not count. The script waits for a confirmed bar close.
Long trigger entry: confirmed close above the call trigger, session and timeframe allowed, entry budget remaining, cooldown finished, and the close beyond any buffer you set.
Long exit: confirmed close back below the call trigger. The stop does not use the buffer.
Short side is the mirror.
After the Golden Gate is open, two extra entries can print: a pullback that tags the trigger again (T-PB), and a pullback to the 10-minute EMA8 inside the gate. The 10-minute EMA8 is requested from the 10-minute timeframe. It is not your chart's own 8 EMA. Above a 10-minute chart that line is only an approximation and those signals are suppressed. The Status row says so.
PDC reclaim is a first-hour 10-minute close back through the previous close after price started the session on the other side of it. It is not a trigger entry. It is a flip warning. It is also suppressed above 10 minutes.
Historical percentages
When they are visible they are historical frequencies from SPY, regular session 09:30-16:00 ET, 3-minute confirmed closes, sample window 2000-2025, compiled as "Milkman stats v2026-08-29". Examples the dashboard and labels may show:
Confirmed call close through the trigger: 73.6 percent reached 38.2 percent the same day. If price then closed back below the trigger, that fell to 59.5 percent.
Median time from a winning call trigger to 38.2 percent: 18 minutes. That is a median, not a deadline.
Trigger day to 38.2 percent: 78.5 percent bull, 79.0 percent bear.
38.2 percent to 61.8 percent: 62.7 percent bull, 65.5 percent bear.
Gate completion from a trigger day: 62.5 percent bull (n=3,421), 65.4 percent bear (n=3,196).
Full ±1 ATR on any day: 13.8 percent up, 16.1 percent down.
The 3-minute close study that produced the 73.6 / 59.5 pair was run on calls only. The script says so on the put trigger. Do not apply that pair to shorts.
These figures are not a win rate for your account, not a forecast, and not valid on QQQ, ES, BTC, a 5-minute chart, weekly levels, or extended-hours closes. If the dashboard says stats are hidden, believe it. The mechanics still run. The percentages do not.
Bilbo
Bilbo is a 1-hour Phase Oscillator state used as context, not as an entry trigger. It can only be read cleanly on a chart of 60 minutes or less. On higher timeframes the dashboard drops the intraday rows rather than inventing a value. Outer-zone states were associated with higher gate-completion frequencies in the same SPY sample. Treat that as sample context, not a filter you must wait for.
How to use it
For the published configuration: AMEX:SPY or SPCFD:SPX , 3-minute, regular hours, Mode = MILKMAN, Level Period left on Day, Use Current Close OFF.
Wait for a confirmed close through the trigger, or for GG / T-PB if you take those.
Stop is a confirmed close back through the same trigger.
Primary target is 61.8 percent. Scale at least half there. Trail remaining size. Do not add at 50 percent.
Read STATUS before you assume the script is broken. It will say if you are on the wrong timeframe, in cooldown, out of entries, or still short of the level.
On crypto, FX, futures, or a 4-hour chart, switch to UNIVERSAL or CUSTOM and ignore percentages.
Swing or Position level periods rebuild the same map from monthly or quarterly ATR. Use a 4-hour or daily chart for those. They are structure, not a 3-minute day-trade signal.
Alerts
Alert text is mechanical on purpose. TradingView freezes alertcondition text at compile time, so the message cannot know your mode or symbol. Percentages live on the dashboard, which does know the scope.
Limitations
Not financial advice. You are responsible for orders, risk, and venue rules.
Percentages describe one historical sample on one product. They can fail going forward.
10-minute EMA8, PDC reclaim, and 1-hour Bilbo are wrong or suppressed above their native timeframes.
Milkman stats require an exact ticker match. SPYG and SPYD do not inherit SPY figures.
A buffer, if set, moves only the entry. You can be in a trade and not yet stopped. The dashboard prints both prices when a buffer is on.
This script plots levels and discrete events. It does not place orders and it is not a strategy report.
Originality
Saty published the close ± ATR fib map and the period selector. This publication keeps that map, credits it, and adds a separate signal and session layer plus scoped historical labels. Code is open so the split is visible. If you only need the original lines, use Saty ATR Levels.
Published under the Mozilla Public License 2.0, subject to TradingView Script Publishing Rules, which take precedence for what may appear in the public library.
Full user guide: What this tool is
Trinity ATR Levels is a map of where the current period sits inside yesterday’s (or last week’s, month’s, quarter’s, year’s) volatility, plus a set of rules for when a bar is allowed to count as an entry or an exit.
It does not know your account size, your options expiry, or whether the next bar will continue. It answers four questions:
Where is price relative to the previous close and the ATR grid?
Has a confirmed close gone through the trigger?
Is the Golden Gate open?
If nothing is printing, why?
If you treat the percentages as a promise, you will misuse it. If you treat the lines as a fixed map and the markers as timestamps of confirmed events, it does what it was built to do.
### What you need on the chart
Add the script to a standard candlestick chart. Do not use Heikin Ashi, Renko, Kagi, line break, point and figure, or range bars if you care about the signals. Those charts change the close that the engine tests.
For the configuration the historical numbers belong to:
Open SPY or SPX.
Set the chart to 3 minutes.
Use regular trading hours for the Milkman mode. Turn extended hours on only if you also want premarket high and low drawn. Premarket lines stay blank without extended hours.
Leave Mode on MILKMAN.
Leave Level Period on Day. Milkman forces Day even if you change the input.
Leave Use Current Close OFF.
Leave Trigger at 0.236 unless you have a reason to move it. Every label reads that input, so the text will follow you if you change it.
If you are on QQQ, ES, NQ, a single name, FX, or crypto, switch Mode to UNIVERSAL before you look at the dashboard. The lines will still draw. The percentages should not.
### The map, from the middle outward
All distances are a fraction of the selected period’s ATR, measured from the previous period close (PDC).
PDC is the spine. On a Day period in Milkman mode it is yesterday’s regular-session close, not last night’s extended print and not the live price.
The call trigger sits 0.236 ATR above PDC. The put trigger sits 0.236 ATR below it. These two lines are the only entry gate and the only mechanical stop. Price touching them is not an event. A confirmed candle close through them is.
38.2 percent of ATR beyond PDC is where the Golden Gate opens. From there to 61.8 percent is the corridor the script treats as the trade. 61.8 percent is the gate target, not a suggestion to hold for a full ATR.
50 percent is halfway through that corridor. The script’s labels tell you not to start a new position there. Reward left to 61.8 is smaller than the risk back to the trigger. If you are already in, you hold and you still use the trigger as the stop.
78.6 percent is past the gate. The intended action on arrival is to trail, not to add.
±1 ATR is the full daily range relative to PDC. In the SPY sample a complete +1 ATR day happened on 13.8 percent of days and a complete −1 ATR day on 16.1 percent of days. Treat it as rare air, take remaining profits, and do not invent a second system beyond it.
Extensions past 1 ATR (1.236, 1.618, 2.0, and so on) are optional. Simple Mode hides them. They are orientation, not entries.
Previous period high and low, and premarket high and low, are extra structure. They are not part of the trigger rule. Premarket needs the 04:00–09:30 window (exchange time) and extended hours enabled.
The 10-minute EMA8 is pulled from the 10-minute timeframe so it is the same line on a 1-minute, 3-minute, or 10-minute chart. Confirmed mode steps every 10 minutes. That staircase is the real completed value. Live mode is smoother and it moves inside the bar. Signals test the confirmed value.
### Confirmed close is the whole mechanic
Saty’s original script drew the lines and stopped. Trinity adds a rule: the event is the close of a finished bar that is allowed to speak.
Allowed to speak means three things at once.
The chart timeframe is allowed. In Milkman that is 3 minutes only. On a 1-minute or 5-minute chart in Milkman, signals stay off and STATUS will say so.
The session is allowed. In Milkman that is regular hours only. Overnight bars do not arm the trigger.
The bar is confirmed. A live wick through the trigger during the forming bar is not an entry.
Exit is the same test in reverse: a confirmed close back through the trigger ends the setup. That invalidation is the filter. In the call-side 3-minute sample, a confirmed close above the trigger reached 38.2 percent the same day 73.6 percent of the time. If price then closed back below the trigger, that dropped to 59.5 percent. The numbers are history. The rule is: if the trigger gives the close back, you are out.
Wicks do not count on the way in and they do not count on the way out.
### The markers you will see
ENTER under or over a bar is a trigger entry. Long is a confirmed close above the call trigger. Short is a confirmed close below the put trigger.
EXIT is the invalidation close back through that same trigger.
GG is the Golden Gate opening: a confirmed close that first reaches 38.2 percent with the trade already allowed. That bar can also be painted gold if you leave gate coloring on.
T-PB is a pullback to the trigger after the gate is already open. The script ranks this as the best expected-value add or re-entry in the sample it displays. It is not a second daily trigger budget item in the same way as ENTER. It is a pullback event.
EMA8 is a pullback to the 10-minute EMA8 while price is inside the gate. Off by default because it prints often. It is suppressed above a 10-minute chart.
PDC is a first-hour reclaim or loss of the previous close on a 10-minute close. First hour means sixty minutes from the session start the mode is using. On SPY in Milkman that is 09:30–10:30 Eastern. It is a flip warning, not an order.
If markers are missing, read STATUS before you hunt through settings. The usual causes are: not 3 minutes, not regular hours, already used the one entry per direction, still inside the cooldown after an EXIT, or the chart is coarser than 10 minutes so EMA8 and PDC reclaim are disabled.
### How to take a long, step by step
Set Milkman on SPY 3-minute before the cash open if you can, so the levels are fixed and you can mark the call trigger and 38.2 / 61.8 before price gets there.
Do nothing in the trigger box except watch. The box is the space between PDC and the call trigger. Occupying it is common. It is not a signal.
When a 3-minute candle closes above the call trigger during regular hours, that is ENTER. In Milkman you get one of those per direction per session. After that, further longs come from T-PB, GG, or EMA8, not from another raw trigger fire.
Stop is already defined: a later 3-minute close back below the call trigger. You do not trail that stop until the gate target is reached. You do not move it to 50 percent. You do not use a wick.
If price reaches 38.2 percent, the gate is open. You may already be in from the trigger. You may enter there immediately. You may wait for a pullback to the trigger. The sample ranked those options in that order of expected value, with a fresh entry at 50 percent last and negative. Use that ranking as context, not as a second strategy.
At 61.8 percent, scale out at least half. Trail what is left. If price continues to 78.6 percent, trail again; do not add. If a full ATR prints, the script’s guidance is to finish the position. Mean reversion toward PDC is the next map, not a reason to press the same trade.
If you get stopped and the session still has time, Milkman will not give you another raw ENTER in that direction. That is intentional. A stop-out is the invalidation. Chasing a second trigger fire is how the 73.6 percent figure becomes the 59.5 percent figure.
Shorts are the mirror image. One extra warning: the 73.6 / 59.5 pair is call-side only. Bear-side labels use the bear frequencies (trigger to 38.2, gate completion, hold rates) and they say so. Do not quote the call study on a put.
### The three modes in practice
MILKMAN is the published study shape. Use it when you want the script to behave like the sample: SPY or SPX, cash session, 3-minute closes, daily ATR, one bite per side. If you take it to TSLA or to a 5-minute chart and wonder why stats vanished or signals died, that is the mode working.
UNIVERSAL is the same ruler on a market that has no cash open. Crypto and FX should live here. Signals run all day. Re-entries are unlimited. A 1 percent ATR buffer sits beyond the trigger so a messy close through the line does not count until price clears it. The stop stays on the trigger, so there is a band where you can be in and not yet stopped. The dashboard prints both prices when that buffer is on. Percentages stay off. Showing 73.6 percent on BTC would be invented evidence.
CUSTOM is a workshop. Every item under Signal Rules starts to matter: which timeframe may fire, which session, how many entries, how many bars of cooldown, how large a buffer, whether pullbacks fire once or on every linger, whether an overnight gap through the trigger still counts, and whether stats hide off the SPY 3-minute Day RTH scope. Change one thing at a time. If you do not know why you are changing it, stay on Milkman or Universal.
### Reading the dashboard
Full layout is the operator panel. Compact keeps the six lines you act on and shortens the wording. Off removes the panel and leaves levels and markers. Above a 1-hour chart the script drops the intraday rows instead of leaving them marked inactive, because the 3-minute entry rules and the 1-hour Bilbo state cannot be evaluated there.
The Mode row is a one-line reminder of which preset is live and whether stats are on.
Location is where price sits on the map: still inside the trigger box, through the trigger, inside the gate, past 61.8, or out at a full ATR.
Watch and Entry tell you what would have to happen next. If the next event is “need a confirmed close above 612.40,” that is the instruction. If the next event is “cooldown, 2 bars left,” that is also the instruction.
Targets and Stop reprint 61.8 and the trigger so you do not have to hunt labels during a fast bar.
Stall guidance is what to do when price is inside the gate and not moving. The default answer is hold until a trigger close against you or a 61.8 print.
Bilbo is the 1-hour Phase Oscillator context: high or low zone, rising or falling. In the same SPY sample, outer-zone states came with higher gate-completion frequencies, with Low+Falling the strongest bear-side figure in that set. You do not wait for Bilbo to take a trigger. You use it to decide how hard you lean on a runner.
Context and Timing cover session phase, first hour, and how the sample behaved in similar locations. Distance prints how far you are from the trigger, 38.2, and 61.8 in price and in percent of ATR, and how far an open trade has traveled through the gate.
STATUS is the line to trust when the chart looks dead. It will say signals are gated off, the timeframe is degraded, the daily budget is spent, cooldown is running, or you are simply waiting and how far the level still is. If STATUS and your eyes disagree, STATUS wins. The script is telling you which rule blocked the print.
The smaller range/ATR info table is Saty’s original idea: period name, how much of the ATR the current period has already used, and the two trigger prices. Green / orange / red on that range reading is utilization, not a signal. A day that has already spent most of its ATR has less room left to the full-range line. That does not forbid a trigger trade. It tells you the remaining runner is smaller.
### Bilbo, without mystique
Bilbo is not a person and it is not an extra level. It is a classification of the last completed 1-hour Phase Oscillator reading into high/low and rising/falling.
The script can only request that 1-hour series cleanly when your chart is 60 minutes or finer. On a 4-hour or daily chart the value you would get is not the completed hour the sample used, so the script stops showing the row.
Use it as a weight, not a gate. A call trigger with High+Rising or High+Falling in the sample completed the gate more often than the unfiltered baseline. A put trigger with Low+Falling was the strongest cell in that grid. None of those cells are 100 percent. None of them override a confirmed close back through the trigger.
### Historical numbers, and how not to lie to yourself
When stats are on, labels and the dashboard splice in frequencies from one compiled block: SPY, regular hours, 3-minute confirmed closes, 2000–2025, version tag Milkman stats v2026-08-29.
A few more figures you will see in Detailed labels, so they are not a surprise:
Trigger day reaching 38.2 percent: 78.5 percent bull, 79.0 percent bear.
38.2 to 61.8: 62.7 percent bull, 65.5 percent bear.
61.8 to 78.6: 68.9 percent bull, 74.7 percent bear.
78.6 to full ATR: 60.9 percent bull, 66.9 percent bear.
Gate completion from the trigger day: 62.5 percent bull, 65.4 percent bear.
Expected-value ranking in that sample put trigger pullback first, immediate 38.2 second, 10-minute EMA8 third, and a fresh 50 percent entry last and negative.
First-hour 10-minute PDC reclaim then reaching a trigger: 73.0 percent in that sample. Reclaim then reaching the gate: 49.0 percent.
Those are counts of past days that did a thing after another thing. They are not the probability of your next trade. They disappear the moment you leave SPY/SPX, leave 3 minutes, leave Day levels, or leave the regular-session close. SPYG is not SPY. The script checks the ticker exactly.
If you publish commentary, quote the scope in the same sentence as the number. “73.6 percent of confirmed SPY 3-minute call closes through the trigger reached 38.2 percent the same day in the 2000–2025 regular-hours sample” is honest. “This setup wins 74 percent of the time” is not.
### Settings that change behavior versus settings that only change paint
Mode, Level Period, ATR length, Trigger share, PDC/ATR session, and Use Current Close change the map or the clock.
Signal Rules change who is allowed to fire. They are ignored unless Mode is CUSTOM, except that Milkman and Universal already stamp their own values onto those same internal switches.
Display, colors, Simple Mode, dashboard position and size, legend, and label detail change what you see. Simple Mode keeps PDC, both triggers, 38.2, and 61.8, and hides 50, 78.6, extensions, prior high/low, and premarket. That is the right first view if the chart is unreadable.
Chart Markers turn ENTER, EXIT, GG, T-PB, EMA8, PDC, and gate-candle color on or off one at a time. Turning markers off does not turn the logic off. Alerts can still fire.
The colour-blind palette replaces gold/green pairs that collapse under deuteranopia. Use it if you cannot separate the default gate and trigger colors.
Runner Target under Trend & Runner is a discretionary extra line at 1.0, 1.236, 1.618, 2.0, 2.618, or 3.0 ATR. It is not the researched gate target. If both tags are on, 61.8 is the gate, the runner tag is optional greed. Do not confuse them.
Alert checkboxes only enable the long or short trigger alerts. The other alertconditions still exist in the script’s alert list when you create an alert on the chart.
### Alerts
Create the alert from this script on the chart, not from a second copy. Pick the condition by name.
ENTER Long / ENTER Short: confirmed close through the trigger.
EXIT Long / EXIT Short: confirmed close back through it.
Gate Open: first 38.2 event.
T-PB: pullback to the trigger with the gate already open.
EMA8 Pullback: 10-minute EMA8 tag inside the gate.
Gate Complete: confirmed close through 61.8.
PDC Reclaim: first-hour 10-minute close back through PDC.
The message body is mechanics only. It will not paste a SPY percentage onto a Bitcoin alert. That is deliberate. Read the dashboard for numbers.
### Timeframes other than 3 minutes
The levels will draw on any chart because they come from a higher-timeframe request. The signals will not always draw.
On 1 minute in Milkman, the engine refuses to fire because the study used 3-minute closes. Switch to Custom and “Any chart timeframe” only if you accept that you have left the sample.
On 5 or 15 minutes the Day levels still sit in the right place. A 15-minute close through the trigger is a different event from a 3-minute close through the trigger. Do not quote the 73.6 percent figure there.
On 1 hour and above, EMA8 pullback, PDC reclaim, and Bilbo are degraded or removed. STATUS and the swing layout of the dashboard are the honest view: location, targets, stop, distance.
On Swing or Position periods the same fibs are built from monthly or quarterly ATR. That is a multi-week map. Read it on a 4-hour or daily chart of a liquid name. Thin small-cap crypto can travel several of those ATRs in a session and then go dead. Daily period is safer there.
### The one setting that breaks the tool
Use Current Close ON rebuilds every line from the live close. Price is then sitting on the anchor by definition. The trigger box is “price between the close and a trigger,” which can never be true when the close is the live price. The gate cannot open. History on the chart becomes look-ahead because each past day is drawn from that day’s own close. The Milkman percentages assume a locked prior close. Turn this on only after the session, to preview tomorrow, then turn it off.
### What this script will not do
It will not size the position.
It will not know your option delta or your expiry.
It will not place the Webull or broker order.
It will not stay honest if you show it on Heikin Ashi and take the signals.
It will not carry SPY frequencies onto another product.
It will not keep a trade alive after a confirmed close back through the trigger just because 38.2 “usually” gets reached.
It will not replace Saty ATR Levels if all you wanted was the quiet fib grid. Use Saty’s script for that. Use Trinity when you want the grid and a clock that says when a close counts.
### A simple daily routine
Before 09:30 Eastern on SPY, load the 3-minute chart, Milkman, current close off. Write down PDC, call trigger, put trigger, upper 38.2, upper 61.8, lower 38.2, lower 61.8.
During the first hour, note whether price is stuck in a box, already through a trigger, or reclaiming PDC on a 10-minute close.
Take at most one raw trigger per side. Prefer a close, not a poke. Put the stop on the other side of that same line as a close, not as a tick.
If the gate opens, manage to 61.8. If it fails back through the trigger, flatten and stop trading that direction on the raw trigger for the rest of the session.
After 16:00, if you want tomorrow’s sketch, flip Use Current Close on for one minute, write the projected levels, flip it off.
If STATUS ever says you are out of scope, you are. Change product or mode on purpose, not by accident.
That is the whole tool: Saty’s ruler, a confirmed-close clock, a gate from 38.2 to 61.8, and a dashboard that tells you when the clock is not allowed to tick. Индикатор

Consolidation DNA | Flux ChartsGENERAL OVERVIEW:
Consolidation DNA is a market structure tool that finds price consolidations and describes what is happening inside them. A consolidation is any stretch where price stops travelling and starts moving sideways in a contained area. Most tools stop at drawing a box around that area. Consolidation DNA draws the box and then measures twelve properties of the price action inside it. Eleven of those measurements are compared against five reference profiles, and the indicator reports which profile the consolidation matches most closely. It has two detection methods, one that builds a range out of consecutive compressed candles and one that builds a range out of a fixed price area that price has stayed inside, and both produce the same output, so a trader can choose whichever suits the instrument and the timeframe.
Once a range is confirmed, the indicator watches for the moment price leaves it. It marks that break, freezes the box at the break bar, and then follows price for a set number of bars afterwards to record how far it travelled away from the range. Those measurements are grouped by consolidation type and shown in a dashboard, so a trader can look at the loaded chart history and see how each type of consolidation behaved after it broke. The five types are Clean Coil, Choppy Range, Directional Pressure, Exhaustion, and High Effort Balance, and each one describes a different kind of sideways market. A Clean Coil and a Choppy Range both look like a box on a chart, but the price action inside them is very different, and the indicator separates them using measurements taken from the candles.
WHAT IS THE THEORY BEHIND THE INDICATOR?
Price spends a large part of every session moving sideways. Traders call these areas consolidations, ranges, bases, or coils. The common idea behind all of these names is the same. Buyers and sellers are close to balanced, so price stays inside a contained area for a while before one side takes control and price leaves the area. The problem is that not every sideways area is the same. Two boxes on a chart can look identical in width and height while the candles inside them tell completely different stories.
In one box, the candles are small, they overlap each other heavily, they close near the middle of the area, they alternate direction only occasionally, and volume is quiet. This is the classic picture of a market winding up, and traders call it a coil. In another box of the same size, the candles have long wicks on both sides, closes land near the edges, direction alternates almost every bar, and volume is higher. This is the picture of a market fighting itself, and traders call it chop. A third box holds together while the closes keep drifting toward one edge and the wicks build up on one side, so price is still contained while pressure builds in a direction. A fourth box holds while volume drops away compared with the period before it and directional progress slows down, which is a market running out of participation. A fifth box shows heavy volume, split fairly evenly between rising and falling candles, while price makes almost no net progress, so a large amount of activity is being taken inside a small area.
These five pictures are the reference profiles the indicator uses. Each one is defined by a set of numeric targets across eleven measurements. When a consolidation confirms, the indicator measures the same eleven properties on the live range and finds which of the five profiles sits closest to it in measurement space. The closeness of that match becomes a fit score, and the distance between the best match and the second best match becomes a confidence gap. Both figures describe how closely the structure resembles a profile, and neither one describes what price is likely to do next. The value of this approach is that the description comes from the price action itself. A trader reading the dashboard sees which measurements are high, which are low, and which profile they add up to, and can form a view about the range from that.
The second half of the theory is the record keeping. Once a range breaks, the indicator follows price for a fixed number of bars and records the furthest it travelled away from the range in the break direction. That travel is expressed as a multiple of the range height, so a two point move away from a two point range and a twenty point move away from a twenty point range both record as one times the range. Grouping those records by consolidation type produces a small table describing what happened after each type of consolidation broke on the loaded chart history.
CONSOLIDATION DNA FEATURES:
Consolidation Detection
Consolidation Classification
Range Break Detection
Expansion Tracking
Consolidation Dashboard
Alerts
CONSOLIDATION DETECTION
🔹 What is Consolidation Detection?
Consolidation Detection is the part of the indicator that finds the sideways areas and draws boxes around them. It runs on every bar and produces a range that has a start bar, a high, and a low. That range moves through two states. It starts as a developing range, which means the indicator has found the beginning of something but the area has not lasted long enough to be treated as real. It then becomes a mature range once it has lasted for the required number of bars.
The classification measurements run while a range is still developing, and the dashboard may show a provisional type before confirmation. Only the classification calculated at maturity is held and used afterwards, and only mature ranges can produce a break or be added to the statistics.
🔹 Why is Consolidation Detection important?
Every other part of the indicator depends on getting the range right. If the box is drawn around the wrong bars, the measurements inside it describe the wrong price action, the classification is wrong, and the statistics are wrong. Two detection methods are offered because instruments behave differently. A fast futures contract on a low timeframe produces clean runs of small candles, which suits candle based detection. A slower instrument, or a higher timeframe, often produces a contained area made of mixed candle sizes, which suits area based detection.
🔹 How is Consolidation Detection calculated?
The Candles method looks at each candle on its own and decides whether it is a compressed candle. A candle is compressed when two conditions are both true. The body must be smaller than half of the total candle height, measured as the distance from open to close against the distance from high to low. The candle height must also be smaller than the four period Average True Range. A candle that has a small body but a large height is not compressed, and a candle that is short but almost all body is not compressed either. Both conditions must be true together.
When a compressed candle appears, a run starts. The bar it appeared on becomes the start of the range, and its high and low become the first range boundaries. Every following compressed candle extends the run, and the range high and range low widen to include that candle. While a range is still developing, the moment a candle appears that is not compressed, the run ends and is cleared completely. The range must be rebuilt from a new compressed candle.
The Visual Range method works on a fixed area. On each bar the indicator takes the highest high and the lowest low of the last three bars and treats that area as a seed range. If price then trades above the top of that area or below the bottom of it, the area is cleared and a new seed is taken from the most recent three bars. If price stays inside, the area is kept and the count of bars inside it grows. The range boundaries in this method do not widen once the seed is set, because any move outside them clears the range and starts a new one.
In both methods, the number of bars the range has lasted is measured from the start bar to the current bar. When that count reaches the required minimum, the range becomes mature. At that moment the range high and range low are frozen and they no longer move.
While a range is still developing, the indicator checks on every bar that the detection run still starts on the same bar it started on before. If the start bar changes, meaning the run was broken and a new one began, the developing range is cleared and its box is removed. Nothing is recorded for a developing range that never matured. This check stops once a range matures. A mature range holds its fixed boundaries and stays active through candles of any size until price breaks out of it.
After a mature range breaks, a new range cannot open from a detection run that began before the break bar. The indicator waits for a run that starts after the break.
🔹 Settings
Detection Method: Chooses how ranges are found. Candles builds the range from consecutive compressed candles. Visual Range builds the range from a fixed price area that price has stayed inside. This changes the logic of the indicator and the default is Candles.
Min. Consolidating Candles: The number of consecutive compressed candles required before a range becomes mature. Lower numbers produce more ranges and shorter ones. Higher numbers produce fewer ranges that lasted longer. This setting is only active when Detection Method is set to Candles. The default is 4 and the range is 1 to 20.
Min. Candles in Range: The number of bars price must stay inside the seed area before the range becomes mature. This setting is only active when Detection Method is set to Visual Range. The default is 20 and the range is 3 to 160.
🔹 Customization
Developing Boxes: Draws the box while the range is still developing. The default is on.
Mature Boxes: Draws the box once the range has matured, and controls whether the box is kept on the chart after the range breaks. When this is off, a mature range still produces breaks and statistics while no box is drawn for it. The default is on.
Developing: The border and fill color used while the range is developing. The default is a light blue.
Mature: The border and fill color used for a mature range whose type reads Unclear. Ranges with a matched type use that type color. The default is a green.
CONSOLIDATION CLASSIFICATION
🔹 What is Consolidation Classification?
Consolidation Classification is the part of the indicator that describes what kind of consolidation has formed. When a range matures, the indicator measures twelve properties of the price action inside it and compares eleven of them against five reference profiles. The closest profile becomes the type of that consolidation, and the type is shown on the box color, on the label, and in the dashboard.
The five types are Clean Coil, Choppy Range, Directional Pressure, Exhaustion, and High Effort Balance. A sixth outcome, Unclear, appears when no profile is close enough.
🔹 Why is Consolidation Classification important?
A box on a chart tells a trader where a range is, and that is all. It says nothing about whether the market inside that box was winding up quietly, fighting itself, leaning in a direction, running out of participation, or absorbing heavy volume. Those are different situations and traders treat them differently. Classification gives the box a description built from the candles inside it, so the box carries information beyond its own outline.
🔹 How is Consolidation Classification calculated?
The indicator measures twelve properties on every bar. Each one is expressed as a number from zero to one hundred so they can be compared with each other.
The three Structure readings describe how contained the area is. Range Tightness compares the height of the current range against a pool of previously confirmed ranges on the same chart, so a high reading means the current range is small compared with the ranges that came before it. Candle Overlap measures how much price area each bar shares with the bar before it, averaged across the range, and a high reading means the bars sit on top of each other cleanly. Close Containment measures the share of closes that land inside the range after a padding is trimmed from the top and the bottom, and a high reading means closes are staying in the middle area.
The three Pressure readings describe whether the range is leaning in a direction. Trend Drift compares the net move from the first close in the window to the last close against the total of every close to close move in between, and a high reading means most of the movement went in one direction. Close Bias measures how far the average close sits away from the middle of the range, where a reading of zero means closes averaged out at the midpoint and a reading of one hundred means closes sat at one edge. Wick Bias measures the difference between total upper wick and total lower wick as a share of all wick, and a high reading means the wicks are concentrated on one side.
The three Chop / Effort readings describe how much back and forth action the area is taking and how busy it is. Flip Rate measures how often a candle points in the opposite direction to the one before it, and a high reading means direction alternated frequently. Wick Rejection measures the total length of all upper and lower wicks as a share of the total candle height across the range, so a high reading means a large part of the price action was wicks. Effort compares the average volume inside the range against the average volume of the window of equal length that came before it, where a reading of fifty means volume matched the earlier window and a reading above fifty means volume was higher.
The three Balance / Exhaust readings cover volume symmetry, the change in pace, and how long the setup has run. Volume Balance measures how evenly the estimated bullish and bearish volume inside the range are matched, where a high reading means the two sides are close to equal and a low reading means one side dominates, and on a symbol that reports no volume this reading is left blank and the profiles are compared on the remaining ten measurements. Slowdown compares the directional progress of the earlier window against the directional progress of the current one, and a high reading means the market made much less directional progress than it did before. Duration compares how long the current setup has lasted against the number of bars required for confirmation.
The Volume Balance reading is an estimate built from one minute candles when the chart timeframe is above one minute. Each one minute candle is counted as bullish or bearish using its body direction, falling back to its close against the previous close when the body is flat, and a candle that is flat on both counts has its volume split evenly between the two sides. That volume is then scaled by how much of the candle's price range overlaps the consolidation. This approximates how much participation happened inside the area. It is not order flow and it is not volume at price data, so it cannot show which side initiated a trade or where inside a candle the volume changed hands. When one minute data is unavailable the estimate is built from the chart candles directly. This measurement reads the most recent thirty bars of the range.
Each of the five profiles holds a target value for eleven of these measurements. The indicator measures the squared difference between every live reading and its target, averages those differences, takes the square root, and subtracts the result from one hundred. That produces a fit score for each profile. The profile with the highest fit becomes the primary type and the next highest becomes the secondary type. Two thresholds then decide what is displayed. If the highest fit is below fifty five, the type reads Unclear, because no profile was close enough to describe the range. If the highest fit is at least fifty five but the gap between the best and second best is smaller than eight, both names are displayed together separated by a slash, because two profiles describe the range almost equally well. When the fit is at least fifty five and the gap is eight or more, a single type name is displayed.
The Duration measurement is calculated and displayed in the dashboard while the five profiles hold no target for it, so it reports on the setup without affecting which type is chosen. Every other measurement in the dashboard is compared against the profiles. The type is recorded at the moment the range matures and it is held from then on. It does not change while the range waits for a break.
🔹 Reading the five types
Clean Coil sits at high Range Tightness, high Candle Overlap, high Close Containment, low Wick Rejection, low Trend Drift, and low Flip Rate. It describes a small, orderly area where the candles sit on top of each other and the closes stay in the middle.
Choppy Range sits at high Wick Rejection and high Flip Rate with weaker Close Containment. It describes a sideways area where direction changes constantly and a large part of the movement is wicks.
Directional Pressure sits at high Trend Drift and high Close Bias with a lean in Wick Bias and volume leaning to one side. It describes a range that is still holding while the closes keep pushing toward one edge. Trend Drift, Close Bias, and Wick Bias are all measured as magnitudes, so this profile reports that a lean exists while it does not name which side the lean favours. The direction is recorded separately at the moment the range breaks.
Exhaustion sits at low Effort and high Slowdown. It describes a contained area where volume has fallen away compared with the earlier window and directional progress has dropped.
High Effort Balance sits at very high Effort and very high Volume Balance while Trend Drift stays low. It describes an area taking heavy volume that is split fairly evenly between rising and falling candles while price makes almost no net progress.
🔹 Settings
Comparison Lookback: The number of previously confirmed ranges kept as the comparison pool for Range Tightness. A larger number compares the current range against a longer history and a smaller number compares it against recent conditions only. The pool fills up as ranges confirm on the loaded chart, so Range Tightness reads a neutral fifty until the first range has been recorded. The default is 200 and the range is 40 to 1000.
Analysis Window: The largest number of bars used to measure the price action inside a range. A range longer than this number is measured using its most recent bars up to this limit. The default is 200 and the range is 10 to 1000.
Inner Close Padding %: The share of the range height trimmed from the top and the bottom before Close Containment counts which closes are inside. A larger number demands that closes sit closer to the middle before they count as contained. A value of zero counts every close inside the range. The default is 10 and the range is 0 to 40.
🔹 Customization
Clean Coil: The color used for boxes, labels, and dashboard text when the type is Clean Coil. The default is teal.
Choppy Range: The color used when the type is Choppy Range. The default is orange.
Directional Pressure: The color used when the type is Directional Pressure. The default is blue.
Exhaustion: The color used when the type is Exhaustion. The default is amber.
High Effort Balance: The color used when the type is High Effort Balance. The default is purple.
Detection Labels: Draws a label above the box on the bar a range matures, showing the type name and the fit percentage. The label carries a tooltip describing the type and listing the fit and the confidence gap. This option requires Mature Boxes to be on. The default is off.
Developing Labels: Draws a label at the midpoint of the box on the bar a developing range starts. This option requires Developing Boxes to be on. The default is off.
RANGE BREAK DETECTION
🔹 What is Range Break Detection?
Range Break Detection is the part of the indicator that decides when a mature range has ended. Price leaving the range in either direction ends the range. The indicator records the bar it happened on, the direction it happened in, and the height of the range at that moment, then freezes the box so it stops extending to the right.
🔹 Why is Range Break Detection important?
The point at which a range ends is the point a trader cares about, because it is where the contained period stops and directional movement begins. It is also the anchor for every measurement that follows. The expansion travel is measured from the range boundary, and it is expressed as a multiple of the range height, so both numbers must be fixed at the break bar for the statistics to mean anything.
🔹 How is Range Break Detection calculated?
The indicator offers two definitions and the trader chooses one. Under Close Break the range ends when a candle closes above the range high or closes below the range low, so a candle that pushes outside the range during the bar and closes back inside does not end it. Under Wick Break the range ends the moment any part of a candle trades above the range high or below the range low, and the close is not considered at all. Close Break therefore produces fewer breaks, each one requiring a candle to settle outside the area, while Wick Break produces more and catches the first touch outside it.
The direction is recorded as up when the range high was broken and down when the range low was broken, and when both boundaries are exceeded on the same bar the upward break takes priority. At that moment the box stops extending and its right edge is fixed at the break bar, where it stays on the chart as a record of the completed range, while the live range is cleared so the indicator can begin looking for the next one.
The Close Break check reads the current close value, and the Wick Break check reads the current high and low. On a bar that has already closed these are the finalized candle values. On the bar currently forming they are live and still moving, so a break can appear and then disappear while the bar is still open, and it settles when the bar closes. An alert set to fire Once Per Bar Close will report only the breaks that survived to the candle close.
🔹 Bullish Example
A mature range holds for several bars while the dashboard release state reads Waiting. A candle then closes above the range high. With Invalidation Method set to Close Break, the range ends on that candle, the box stops extending and its right edge is fixed at that bar, and a Break Up label is placed at the range high. From that bar the indicator begins measuring how far price travels above the range high, and it continues for the number of bars set in Expansion Window.
🔹 Bearish Example
A mature range holds for several bars while the dashboard release state reads Waiting. A candle then closes below the range low. With Invalidation Method set to Close Break, the range ends on that candle, the box stops extending and its right edge is fixed at that bar, and a Break Down label is placed at the range low. From that bar the indicator begins measuring how far price travels below the range low, and it continues for the number of bars set in Expansion Window.
🔹 Settings
Invalidation Method: Chooses the definition used to end a mature range. Wick Break ends the range on any trade outside the boundaries. Close Break requires a candle to close outside the boundaries. The default is Close Break.
🔹 Customization
Release Labels: Draws a label at the broken boundary on the break bar, reading Break Up or Break Down. The label carries a tooltip listing the method used, the type of the range, the fit percentage, and the range height. The default is off.
Max Stored Boxes: The largest number of completed boxes kept on the chart. Once the count passes this number, the oldest completed box is removed. The default is 80 and the range is 10 to 180.
Max Stored Labels: The largest number of labels kept on the chart across all label types. Once the count passes this number, the oldest label is removed. The default is 120 and the range is 10 to 400.
EXPANSION TRACKING
🔹 What is Expansion Tracking?
Expansion Tracking follows price after a range has broken and records the furthest it travelled away from the range in the break direction. It watches for a set number of bars, records the largest travel it saw, and then adds that record to a running total for the consolidation type.
🔹 Why is Expansion Tracking important?
A break on its own says only that price left the area. It says nothing about how far it went afterwards. Measuring the travel and expressing it as a multiple of the range height makes those measurements comparable across instruments, timeframes, and range sizes, which means they can be grouped and averaged. Grouping them by consolidation type produces a description of how each type behaved after breaking on the loaded chart history.
🔹 How is Expansion Tracking calculated?
When a mature range breaks, the indicator starts a record holding the break direction, the two range boundaries, and the height of the range at that moment, and from that point onward it measures on every bar how far price has travelled away from the broken boundary. For an upward break that travel is the distance from the range high up to the bar high, and for a downward break it is the distance from the range low down to the bar low, so only movement away from the range counts and a bar that trades entirely back inside contributes zero. Each measurement is divided by the range height and compared against the largest value seen so far, and whenever a new largest value appears the indicator records the bar and the price where it occurred so that exact point can be marked on the chart.
The record continues until the window set in Expansion Window has elapsed, counting the break bar itself as the first bar of that window, at which point the largest travel it saw is added to the running total for that consolidation type, the sample count for that type is added to, and the record itself is removed. Records that are still inside their window are held back and they join the averages once their window has finished. Because every measurement is expressed against the height of its own range, a travel equal to one hundred percent of the range height displays as one times, so a range that was ten points tall followed by a move of eighteen points away from the boundary records as one point eight times, which lets ranges of very different sizes be compared on one scale.
Every mature range that breaks is credited to the type profile that scored highest for it, and this includes ranges whose label read Unclear, where the fit sat below the display threshold and no type name was shown. Those breaks are still recorded and they are credited to whichever profile came closest. This is a fixed convention in the indicator, so the counts in the dashboard describe every break that occurred on the loaded chart.
🔹 Settings
Expansion Window: The length of the measurement window, counted from the break bar. The break bar itself counts as the first bar, so a value of 50 covers the break bar and the 49 bars that follow it. A short window records the immediate reaction to the break. A long window records how far the move eventually reached. Changing this number changes every average in the dashboard, because it changes how long each break is followed. The default is 50 and the range is 1 to 500.
🔹 Customization
Expansion Labels: Draws a label showing the travel as a multiple of the range height. It is placed once the window has finished, on the earlier bar where the furthest travel occurred, so it marks a completed outcome in hindsight and it is not present while that move is happening. The default is off.
CONSOLIDATION DASHBOARD
🔹 What is the Consolidation Dashboard?
The Consolidation Dashboard is a table drawn on the chart that reports the current state of the indicator and the history it has recorded. It has three parts. The header reports what state the indicator is in and which type the active setup matches. The middle section reports twelve readings for the active setup, which are the eleven compared against the profiles plus Duration. The lower section groups the recorded breaks by type.
🔹 Why is the Consolidation Dashboard important?
The box and its color report the conclusion. The dashboard reports the measurements the conclusion was drawn from, together with Duration, which describes the setup without feeding it. A trader who can see that Range Tightness is at ninety, Candle Overlap is at eighty five, and Flip Rate is at fifteen understands why the range was described as a Clean Coil, and can also see when a reading is borderline. The type and the fit percentage are held from the moment the range matured while the measurement rows keep updating on every bar, so on a range that has been holding for a while the live readings describe the range as it stands now and the type describes it as it was at confirmation. Every cell in the table carries a tooltip explaining what it measures.
🔹 How is the Consolidation Dashboard calculated?
The header row reports the state of the indicator. It reads No active setup when nothing has been found, Developing while a range is forming, and Mature once a range has confirmed. A range is cleared on the bar it breaks, so from that bar the header returns to No active setup until the next range is found. Beside the state, the header reports the type name and the fit percentage. When a range matched two profiles closely, a second header row appears carrying the second type name and its fit percentage.
The Current Setup row appears while a setup is active. It reports the range low and the range high as a pair, and it reports the release state. The release state reads Not confirmed while the range is still developing and Waiting once it has matured and is holding.
The four measurement rows appear once the active setup has lasted at least a quarter of the bars required for confirmation, and they carry three readings each. Structure reports Range Tightness, Candle Overlap, and Close Containment, which together describe how contained the area is. Pressure reports Trend Drift, Close Bias, and Wick Bias, which together describe whether the range is leaning in a direction. Chop / Effort reports Flip Rate, Wick Rejection, and Effort, which together describe how much back and forth action the area is taking and how busy it is. Balance / Exhaust reports Volume Balance, Slowdown, and Duration. Volume Balance and Slowdown both feed the classification, and Slowdown carries its highest target of any profile in Exhaustion, while Duration describes the setup without feeding it.
The History by Type section lists all five types with two columns. Samples reports how many breaks of that type have completed the full Expansion Window. Avg Max Expansion reports the average of the furthest travel across those completed breaks, shown as a multiple of the range height. Hovering a Samples cell shows the total number of breaks detected for that type, including any that are still inside their window.
Every figure in the History section describes what occurred on the loaded chart history. Loading more history, changing the timeframe, or changing Expansion Window will change these figures.
🔹 Settings
Show Dashboard: Draws the dashboard table on the chart. The default is on.
Position: Places the dashboard at one of nine points on the chart. The options are Top Right, Top Center, Top Left, Middle Right, Middle Center, Middle Left, Bottom Right, Bottom Center, and Bottom Left. The default is Top Right. This dropdown sits beside Show Dashboard and carries no label of its own.
Size: Sets the text size of the dashboard. The options are Tiny, Small, Normal, Large, and Huge. The default is Normal. This dropdown sits beside the position dropdown and carries no label of its own.
ALERTS
🔹 What are the Alerts?
The indicator provides nine alert conditions covering confirmation and range breaks, so a trader can be told when a range confirms, what kind of range it is, and which way it eventually left.
🔹 How are the Alerts calculated?
Consolidation Confirmed fires on the bar a range matures, whatever type it was given. Five further conditions cover the individual types, named Clean Coil Confirmed, Choppy Range Confirmed, Directional Pressure Confirmed, Exhaustion Confirmed, and High Effort Balance Confirmed. Each of those fires on the same bar as the general confirmation when the range matched that type. A range carrying a combined label fires the condition for the profile that scored highest, and a range reading Unclear fires the general confirmation only.
Range Break fires on the bar a mature range is broken in either direction, and Range Break Up and Range Break Down split the same moment by side, so a trader can act on one direction alone. All three follow whichever definition is set in Invalidation Method. Developing ranges that are cleared without maturing produce no alert at all.
Conditions are created through the TradingView alert dialog by selecting the indicator and then choosing one from the condition list.
IMPORTANT NOTES:
The Volume Balance measurement is an estimate that reads one minute data through a lower timeframe request, and this happens only when the chart timeframe is above one minute, so on a one minute chart and on any chart where one minute data is unavailable for the symbol the estimate is built from the chart candles themselves, and instruments that publish no volume leave the Volume Balance row blank, in which case the measurement is left out of the profile comparison entirely so the gap cannot push the result toward any one type. The comparison pool used for Range Tightness is built from confirmed ranges on the loaded chart and it starts empty, so Range Tightness reports a neutral fifty until the first range has been confirmed and added, the reading becomes more meaningful as the pool grows toward the number set in Comparison Lookback, and loading more chart history fills the pool faster. Every figure in the History by Type section is built from the chart currently loaded, so scrolling back to load more bars, switching timeframe, switching symbol, or changing Expansion Window will rebuild these figures from scratch, while breaks that are still inside their Expansion Window are held and they join the averages once their window has finished. The type recorded for a range is fixed at the moment the range matures and it is measured from the bars available at that point, meaning a range that changes character after it confirms keeps the type it was given. Ranges that are still developing produce no records of any kind, and if a developing range is cleared before it matures its box is removed and nothing is added to the statistics. Turning Mature Boxes off removes the box drawing for mature ranges while the detection, classification, breaks, alerts, and statistics all continue to run, and with that option off no completed box is left on the chart after a break.
UNIQUENESS:
Most consolidation tools answer one question, which is where the range sits, while Consolidation DNA answers that question and then answers a second one, which is what kind of range it is. The classification is built from twelve measurements of the candles inside the range, eleven of which are compared against five reference profiles, and it is reported with a fit percentage and a confidence gap so a trader can see how strong the match is, and when two profiles describe the range almost equally well the indicator displays both names together, while a range that matches nothing closely enough is reported as Unclear. The measurement set itself covers ground that range tools normally leave out, because alongside the expected structural readings of tightness, overlap, and containment, the indicator measures how often candle direction alternates, how wick length is split between the two sides, how average close location sits against the middle of the range, how current volume compares with the window that came before it, and how much directional progress has slowed, while the bullish and bearish volume split is estimated from one minute candles and scaled by how much of each candle's price range overlaps the consolidation, so candles with less price range overlap carry less weight in the balance reading. The indicator also keeps its own record of what happened after each range ended, where travel away from the range is expressed as a multiple of the range height, which makes measurements from a two point range and a two hundred point range directly comparable, and those measurements are grouped by consolidation type to produce a small table describing how each type of consolidation behaved after breaking on the chart in front of the trader. Historical figures are built from finalized candles, while readings on the bar currently forming remain provisional until it closes. Two detection methods are offered so the tool fits different instruments and timeframes, and both feed the same classification and record keeping, while every measurement in the dashboard carries a tooltip explaining what it means and most drawing categories can be turned on or off separately, with developing and detection labels depending on their matching box setting, so the chart can be reduced to boxes alone or expanded to show labels at detection, at maturity, at the break, and at the point of furthest travel. Индикатор

AMD Session Map [AFD]
Three measured boxes per session cycle — Accumulation, Manipulation, Distribution — drawn only where the rules qualify one, each on a confirmed bar. The same read runs on higher-timeframe bars as a thin coloured rule along the bottom of the pane.
The three phases
Accumulation — the balance box. Adaptive RTH takes a contained window of about 40 minutes anywhere in the session, whole bars, four-bar minimum, no wider than the 30th percentile of the last 30. Opening 60 / 90 min instead take a fixed stretch from 09:30 New York, one cycle a day.
Manipulation — the sweep box, from the swept boundary to the extreme reached. The panel names the boundary and the time. No sweep within 90 minutes of the balance completing: timeout.
Distribution — the post-reclaim box, from the close back inside the balance to the end of the cycle. No reclaim within 30 minutes of the first sweep bar: timeout. Resolution — closed up, closed down, or named for what it did: unfinished at the close, both boundaries swept, closed back on the sweep side, deadline passed. Never rounded to a side.
The higher-timeframe ribbon One thin rule per period along the bottom of the pane. Daily is on by default ; Weekly, Monthly and Quarterly are switches. Each period's range comes from the first four completed bars of its container — Daily in the month, Weekly in the quarter, Monthly in the year, Quarterly in a four-year cycle. Unresolved periods are neutral grey. A rule holds no price coordinate, so the ribbon never moves the price scale. Show it as panel rows, as the ribbon, as both, or not at all. It never feeds the intraday detector.
Higher-timeframe requests — the lookahead disclosure Four requests, one per period , each for a completed-bar tuple. Every value is offset by one bar with the history-referencing operator inside the request expression, paired with barmerge.lookahead_on — the pairing the Pine Script documentation names as the way to return only confirmed values on all bars, whatever the bar state. Checked on Bar Replay: stepping through 25–26 August left the historical ribbon colors and the panel's higher-timeframe rows identical to the same bars outside replay. The consequence, by design: a higher-timeframe value is always one completed higher-timeframe bar behind.
Scope Standard chart type, 1 to 15 minutes, exchange timezone America/New_York. The timezone is the whole test — asset class is not checked. Exchange-designated regular-session bars only, inside the nominal 09:30–16:00 window. Early closes follow the exchange's own last-regular-bar flag; pre/post-market bars are excluded even when extended hours are displayed. Outside that scope the panel reports UNSUPPORTED and intraday fields stay empty rather than carry a value the model did not measure.
Adaptive RTH
Opening 60
Opening 90 - Selective volatility
Settings Accumulation model — Adaptive RTH, which can map repeat cycles in one day, or Opening 60 / 90 min, which map one.
Confirmation profile — Structure + volatility context applies no size filter; ATR ratios are reported and change nothing. Selective volatility-confirmed adds two: the sweep must clear the boundary by 0.10x ATR, and the bar closing past the far boundary needs a body of at least 0.50x ATR and at least half its own range. Structure only keeps ATR out of every decision.
Presentation — Map draws the boxes over your native candles; Phase candles also recolours the confirmed sweep and distribution bars; Full emphasis adds a background tint.
Panel — the live phase, the balance range, the swept boundary and its time, the reclaim, and one row per enabled higher-timeframe period. Seven positions, or switched off; it still draws on an unsupported chart.
Data Window — nineteen fields: five geometry levels, six Wilder ATR(14) measurements, and two accumulation levels per higher-timeframe period.
Data and limitations Rule-based chart geometry; AMD terms do not establish participant intent or future outcome. Phase names label what the rules measured — a contained range, trade beyond its boundary, a move after the reclaim — and nothing about who traded or why. Every decision is made on a confirmed bar. A cycle in progress is shown as in progress. A higher-timeframe value lags by one completed higher-timeframe bar, as described above. Six cycles are retained and older ones dropped — up to three boxes each, against the 60 this script declares. No alerts, signals, entries, exits, scores, rankings, projections, or performance claims. It does not tell anyone what to do with what it draws.
Originality An Auction Foundry implementation of the Accumulation / Manipulation / Distribution framework. The adaptive balance admission, the sweep and reclaim deadlines, the volatility latching and the calendar read are all in the published source. Free to use, open-source under the Mozilla Public License 2.0. Индикатор

Modern VWAP with BandsModern VWAP with Bands is an anchored Volume Weighted Average Price overlay designed to show how far price has moved from its current volume-weighted reference and highlight unusually extended conditions that may be relevant to mean-reversion analysis.
The indicator combines an anchored VWAP, five configurable deviation bands, distance-based candle coloring, outer-band reversion signals, configurable Target and Stop reference levels, and separate historical Bull and Bear signal-outcome tables.
WHAT THE INDICATOR CALCULATES
The Trading Style setting determines the VWAP anchor period and price source.
Intraday = Daily VWAP using HLC3.
Swing/Daily = Weekly VWAP using HL2.
Long-term = Monthly VWAP using Close.
The VWAP resets automatically when the selected Daily, Weekly or Monthly anchor changes.
Five upper and five lower deviation bands are calculated around VWAP.
When ATR Bands is enabled, each deviation level represents an ATR multiple.
When ATR Bands is disabled, each deviation level represents a percentage offset from VWAP.
This allows the band structure to adapt either to current volatility or to fixed percentage distance from the VWAP reference.
WHY THE COMPONENTS ARE COMBINED
VWAP provides the central volume-weighted reference.
The deviation bands measure progressively larger extensions away from that reference.
The candle-coloring system provides a visual representation of how extended price currently is.
The outer Dev 5 signal logic identifies occasions when price moves through the most extreme configured band.
The Bull and Bear tables then provide historical context showing how those signals resolved using the selected Target and Stop assumptions.
Together, these components provide a workflow for identifying the current VWAP reference, measuring extension, highlighting extreme movement, identifying outer-band events and reviewing their historical outcomes.
BAR COLOR DISTANCE
Bar Color Distance Mode controls how distance from VWAP is normalized.
ATR mode measures absolute distance from VWAP relative to ATR.
% VWAP mode calculates the absolute percentage distance from the VWAP itself:
Absolute distance from VWAP / VWAP × 100
For example, if VWAP is 100 and the selected price source is 102, the % VWAP distance is 2%.
Auto mode uses ATR normalization when ATR Bands is enabled and % VWAP normalization when percentage bands are being used.
This keeps the candle-color distance measurement aligned with the selected band methodology.
REVERSION SIGNALS
A Bull reversion signal occurs when the closing price crosses below the lower Dev 5 band.
A Bear reversion signal occurs when the closing price crosses above the upper Dev 5 band.
These signals identify extreme extensions from VWAP. They do not confirm that a reversal has already started and should not be interpreted as predictions that price must return to VWAP.
Require Outside Dev 5 can apply an additional extension requirement beyond the Dev 5 band before a signal is accepted.
Dev 5 Outside % controls how far beyond Dev 5 price must extend when this filter is enabled.
The optional Cool Off Period prevents another accepted signal for a selected number of bars after the previous signal.
Show Reversion Signals controls only the visibility of the Bull and Bear markers. The underlying signal calculations and historical outcome tracking continue to operate when the markers are hidden.
ENTRY, TARGET AND STOP
The reference entry for both Bull and Bear signals is the closing price of the signal candle.
Bull Stop is positioned below the Bull reference entry according to Bull Stop %.
Bear Stop is positioned above the Bear reference entry according to Bear Stop %.
Target Source can be set to User % or VWAP.
With User % selected, Bull Target % and Bear Target % determine the Target distance from the signal-bar close.
With VWAP selected, the Target is the VWAP value that existed when the signal occurred.
The VWAP Target is fixed at that signal-bar value. It does not continue moving as the VWAP changes on later candles.
The Target and Stop lines displayed on the chart use the same corresponding values used by the historical outcome tables.
HISTORICAL SIGNAL-OUTCOME TABLES
The Bull and Bear tables provide simplified historical signal-outcome statistics.
T = Target reached.
S = Stop reached.
The displayed percentage is the number of Target outcomes divided by the total number of resolved Target and Stop outcomes for that direction.
The percentage is an internal historical measurement produced by the indicator's predefined evaluation rules. It is not a probability, expected win rate, accuracy prediction or guarantee of future performance.
The reference entry is the close of the signal candle.
Target and Stop evaluation begins on the following candle. Price movement that occurred earlier within the signal candle is therefore not used to determine an outcome after an entry at that candle's close.
If both the Target and Stop are touched during the same later candle, OHLC data cannot determine which level occurred first. The script therefore records the event conservatively as a Stop outcome.
Only one unresolved Bull simulation and one unresolved Bear simulation can be active at the same time.
If another signal in the same direction occurs while that direction already has an unresolved event, it is not added as another independently scored table event.
When Ignore Open Trades on Reset is enabled, unresolved events are discarded when the selected VWAP anchor resets. They are not counted as either a Target or Stop outcome.
These tables are analytical summaries and are not TradingView Strategy Tester backtests.
HOW TO USE
Start by selecting the Trading Style that matches the VWAP reference you want to analyse.
Use Intraday for a Daily VWAP, Swing/Daily for a Weekly VWAP, or Long-term for a Monthly VWAP.
Choose whether the deviation structure should react to current volatility using ATR Bands or represent fixed percentage distances from VWAP.
The inner deviation bands show smaller extensions from VWAP while the outer bands represent progressively larger extensions.
Use the candle colors as a quick visual indication of the current distance from VWAP.
Bull signals identify closes crossing below the lower Dev 5 band.
Bear signals identify closes crossing above the upper Dev 5 band.
These are extreme-extension conditions rather than automatic trade instructions. They can be combined with the trader's own price structure, trend, momentum, support/resistance or other confirmation methods.
Require Outside Dev 5 can be enabled when a greater extension beyond the outer band is desired.
The Cool Off Period can reduce repeated signals when price repeatedly moves around the outer band.
The Bull and Bear tables can then be used to examine how historical signals resolved under the currently selected Target and Stop assumptions.
IMPORTANT SETTINGS
Trading Style controls the VWAP anchor and source.
ATR Bands selects ATR-based or percentage-based deviation bands.
ATR Length controls the volatility calculation used by ATR bands and ATR-normalized visual calculations.
Level 1 Dev through Level 5 Dev control the five distances around VWAP.
Bar Color Distance Mode selects ATR or % VWAP normalization for candle coloring.
Bar Color Contrast Power controls how quickly color intensity increases as price moves farther from VWAP.
Bar Color Outside Boost increases visual emphasis after the most extreme configured distance is exceeded.
Require Outside Dev 5 adds an additional extension filter to signal generation.
Cool Off Period controls the minimum spacing between accepted signals when enabled.
Target Source selects percentage-based Targets or the fixed VWAP value at the signal.
Bull Target %, Bull Stop %, Bear Target % and Bear Stop % define the assumptions used for the corresponding historical signal-outcome calculations.
SIGNAL TIMING AND REPAINTING
The script does not use future-data lookahead, higher-timeframe request.security calculations, pivot calculations or historical pivot backplotting.
Signals are calculated using the current chart candle.
Because the closing price of a live candle changes while that candle is forming, a Bull or Bear signal can appear and disappear before the candle closes.
Once the candle has closed, that historical signal condition is fixed.
The script does not place a confirmed signal retrospectively onto an earlier pivot candle.
LIMITATIONS
VWAP depends on the volume data supplied for the selected chart symbol. Volume can differ between exchanges, brokers and data feeds, so VWAP and its resulting bands may also differ.
The indicator uses chart OHLCV data. It does not use order-book data, bid/ask trade classification or individual transaction-level order flow.
ATR is a historical volatility calculation and responds to changing market conditions rather than predicting them.
Extreme distance from VWAP does not guarantee mean reversion. Price can continue moving farther away from VWAP after a Bull or Bear signal.
Live-candle conditions can change before the candle closes.
The Bull and Bear historical statistics do not model commissions, spread, slippage, execution delay, liquidity, partial fills, leverage, position sizing or true intrabar sequencing.
When both Target and Stop occur inside the same candle range, the actual sequence cannot be determined from OHLC data and the event is therefore classified as a Stop.
Unresolved simulations can be removed at VWAP anchor resets when Ignore Open Trades on Reset is enabled.
The pre-reset and post-reset fading effects are visual features based on the expected length of the selected anchor period. Markets with restricted sessions or gaps may contain a different number of actual chart bars.
Historical results do not imply future performance.
ORIGINAL FUNCTIONALITY
Modern VWAP with Bands is designed as more than a standard VWAP plot.
Its implementation integrates selectable Daily, Weekly and Monthly VWAP anchoring, five ATR-or-percentage deviation zones, VWAP-relative or ATR-normalized candle coloring, configurable extreme-band signal filtering, fixed VWAP-or-percentage Targets, configurable Stops, anchor-reset handling and separate Bull and Bear historical outcome tracking.
The purpose of combining these elements is to connect VWAP location, distance measurement, visual extension analysis, signal generation and historical signal evaluation within one consistent overlay.
Индикатор

PDH PDL PWH PWL Boundary Response RegisterOVERVIEW
PDH PDL PWH PWL Boundary Response Register is an open-source prior-range research tool for time-based intraday charts and the 1D chart.
It plots four raw boundaries from completed higher-timeframe periods:
* PDH: Previous completed daily high
* PDL: Previous completed daily low
* PWH: Previous completed weekly high
* PWL: Previous completed weekly low
The script then records how the current day or week interacts with each boundary.
Its purpose is descriptive research. It does not calculate a conventional pivot ladder, assign support or resistance, predict direction, identify a target, generate entries or exits, or report win rates or profitability.
BOUNDARY LIFECYCLE
Each enabled boundary maintains an independent lifecycle for its active source period:
1. Untested
No confirmed contact has been recorded under the selected contact definition and tolerance.
2. Contacted
The boundary has received its first confirmed contact.
3. Sustained beyond
The configured number of consecutive confirmed closes finished beyond the boundary.
This state is independent of direct wick or body contact, so a price gap can satisfy the confirmed-close condition without first recording a conventional wick or body contact.
4. Re-entered
After Sustained beyond, a confirmed close crossed back through the boundary into the corresponding previous-day or previous-week range.
These states are factual classifications.
Sustained beyond does not mean that a breakout will continue. Re-entered does not mean that a reversal will follow.
CONTACT DEFINITIONS
The Contact definition input provides three research modes:
* Wick range: the confirmed bar's high-low range reaches the boundary.
* Candle body: the confirmed bar's open-close body reaches the boundary.
* Close-to-close span: two consecutive confirmed closes straddle the boundary, including a gap when the closes lie on opposite sides.
Contact tolerance can be configured as:
* Exact
* Ticks
* A fraction of the last completed daily ATR
These settings change the contact measurement rule. They do not change the underlying PDH, PDL, PWH, or PWL price.
POST-CONTACT RESPONSE REGISTER
After the first confirmed contact, the script can record an independent response profile for each boundary.
The measurements include:
* First-contact form: Gap beyond, Close through, Wick through, or Boundary touch.
* Confirmed post-contact observation count.
* Outside-close residency: the percentage of confirmed post-contact observations that closed beyond the boundary.
* Close-side recross count: the number of confirmed changes between the inside and outside sides of the boundary.
* Maximum outside excursion.
* Maximum return into the corresponding prior range.
* Chart bars from first contact to Sustained beyond.
* Chart bars from Sustained beyond to the first Re-entered event.
The register abbreviates two response fields:
OUT/X
* OUT: outside-close residency percentage.
* X: confirmed close-side recross count.
MAX O/I
* O: maximum outside excursion.
* I: maximum return into the corresponding prior range.
Maximum excursions are normalized with a daily ATR value frozen at the relevant daily or weekly reset.
These values describe the currently active source period. They are not historical probabilities, confidence scores, success rates, expectancy measurements, or performance statistics.
CROSS-HORIZON RANGE GEOMETRY
The register also measures how the completed daily and weekly ranges relate to each other.
Its cross-horizon fields include:
* The current confirmed close's coordinate inside the previous-day range.
* The current confirmed close's coordinate inside the previous-week range.
* Daily contact coverage for PDH and PDL.
* Weekly contact coverage for PWH and PWL.
* Bar separation between the two boundaries when both boundaries in a pair have been contacted.
* Daily and weekly range containment or overlap.
* The mathematical intersection of the previous daily and weekly ranges.
* The shared interval as a percentage of each prior range.
* Current day range use relative to the previous completed daily range.
* Current week range use relative to the previous completed weekly range.
* PDH/PWH separation in completed daily ATR units and ticks.
* PDL/PWL separation in completed daily ATR units and ticks.
* Configurable nearby-pair detection.
* A four-level hull formed by the outermost values of PDH, PDL, PWH, and PWL.
* The current close's coordinate inside that hull.
* The hull's upper and lower boundary anchors.
* The hull width in completed daily ATR units.
* State breadth across all enabled boundaries.
State breadth reports how many enabled boundaries have reached:
* C: Contacted
* S: Sustained beyond
* R: Re-entered
The shared corridor, nearby pairs, range relation, and four-level hull are geometric references.
The script does not classify them as support, resistance, liquidity, supply, demand, accumulation, distribution, institutional levels, or trade setups.
VISUAL OUTPUT
The default presentation includes:
* Distinct PDH, PDL, PWH, and PWL lines.
* Different default styling for daily and weekly boundaries.
* Optional prior-day and prior-week range ribbons.
* Optional shared-corridor highlighting.
* Optional nearby-pair highlighting.
* Historical daily and weekly segments with adjustable retention.
* Reduced emphasis for completed historical segments.
* Optional first-contact or full-lifecycle event marks.
* Compact right-edge identification tags.
* Automatic merging of nearby daily and weekly tags.
* Optional dotted leaders when a display tag is displaced from its exact boundary price.
* A fixed Boundary Response Register in the selected chart corner.
The right-edge tags use the currently visible chart range, visible bar count, completed daily ATR, and tick-size floors only to resolve annotation spacing and future-side placement.
The tags can reposition when the chart is scrolled or zoomed.
This visual repositioning does not change:
* The exact PDH, PDL, PWH, or PWL prices.
* Horizontal boundary-line prices.
* Lifecycle states.
* Post-contact response measurements.
* Range geometry.
* Alert conditions.
Exact prices and full state details remain available in the Boundary Response Register and label tooltips.
DATA HANDLING AND REALTIME BEHAVIOR
PDH, PDL, PWH, PWL, and the ATR normalization value are requested from completed higher-timeframe bars.
The expressions used with higher-timeframe lookahead are offset by one completed higher-timeframe bar before being used. The four active boundary prices therefore do not change during their corresponding current day or week.
Lifecycle and response events are committed on confirmed chart bars.
The combined dynamic alert also uses once-per-bar-close frequency.
Some current-context fields can continue changing while the realtime bar is open, including:
* Current close distance from each boundary.
* Current day range use.
* Current week range use.
* Developing current-period high and low values.
Those current-context fields are distinct from confirmed lifecycle history.
SOURCE MODES
Three reference-data modes are available:
Automatic
Uses the chart context on standard charts and standard-symbol candles on non-standard charts.
Chart context
Preserves the current chart's ticker context and modifiers.
Standard candles
Requests standard market candles without non-standard chart construction or other ticker modifiers.
When the selected event source has no usable bar aligned with the current chart timestamp, event evaluation pauses instead of treating an older forward-filled candle as a new observation.
NON-STANDARD CHARTS
Heikin Ashi, Renko, Kagi, Line Break, Point and Figure, Range, and other non-standard charts can contain synthetic OHLC values.
The completed daily and weekly boundaries remain available, but lifecycle events, current-range progress, and related alerts are disabled by default on non-standard charts.
Users can enable non-standard-chart event evaluation only for explicit research.
SUPPORTED TIMEFRAMES
The script supports:
* Time-based intraday charts.
* The 1D chart.
Tick charts and timeframes above 1D are excluded because their relationship with the requested event data would require ambiguous lower-timeframe reconstruction.
An on-chart notice is displayed when the selected timeframe is unsupported.
IMPORTANT 1D LIMITATION
On the 1D chart, the daily boundary lifecycle resets on each new daily bar.
PDH and PDL therefore cannot accumulate more than one daily close before the next daily reset.
When Closes required beyond is set above 1, the multi-close Sustained beyond state for PDH and PDL is primarily meaningful on intraday charts.
PWH and PWL can still accumulate multiple daily closes during the active week.
For full daily-boundary lifecycle and post-contact research, a time-based intraday chart is recommended.
ALERTS
Factual alert conditions are available for:
* First confirmed contact of any enabled boundary.
* First confirmed contact of each individual boundary.
* Sustained beyond for any enabled boundary.
* Sustained beyond for each individual boundary.
* Re-entered for any enabled boundary.
* Re-entered for each individual boundary.
* Formation of a nearby PDH/PWH pair.
* Formation of a nearby PDL/PWL pair.
* Completion of the daily contact pair.
* Completion of the weekly contact pair.
* A configurable outside-close residency threshold.
* A configurable maximum outside-excursion threshold.
* A combined confirmed-bar alert() message that consolidates simultaneous events.
Alerts report observed conditions only.
They do not instruct the user to buy, sell, enter, exit, place a stop, or select a profit target.
HOW TO USE
1. Apply the script to a standard time-based intraday chart or the 1D chart.
2. Select Automatic, Chart context, or Standard candles according to the data context being researched.
3. Enable daily and weekly boundaries and select the amount of historical retention.
4. Choose the contact definition and tolerance.
5. Select the number of confirmed closes required for Sustained beyond.
6. Read each boundary's lifecycle together with OUT/X and MAX O/I rather than interpreting a horizontal line in isolation.
7. Use the lower register rows to compare daily and weekly range geometry, shared overlap, current range use, pair spacing, hull position, and state breadth.
8. Adjust nearby-pair thresholds, historical event-mark density, right-edge tag content, and register size for the symbol and timeframe.
9. Use Market Replay and multiple symbols to verify customized settings before creating alerts.
WHY THIS IS A SEPARATE PUBLICATION
This study is separate from Previous Day Pivot Path - Intraday Support Resistance because the two scripts address different research questions and use different analytical structures.
Previous Day Pivot Path is a previous-day pivot-formula and arrival-order study. It calculates P, R, and S levels, supports pivot formula families, records first-arrival rank, distinguishes reached and unreached levels, and can emphasize the next unreached level. PDH and PDL are optional context references in that study.
Boundary Response Register calculates no:
* P/R/S ladder.
* CPR.
* Pivot formula family.
* Pivot arrival rank.
* Reached-versus-unreached path.
* Next unreached level.
* Next target.
Its four primary objects are the raw completed-period boundaries PDH, PDL, PWH, and PWL.
It tracks:
* Their independent lifecycle.
* Their post-contact response measurements.
* Daily and weekly range geometry.
* Shared range overlap.
* High-pair and low-pair spacing.
* Four-level hull position.
* State breadth.
Combining these functions into the existing pivot study would materially change that publication's purpose, supported horizon, default output, settings structure, alerts, and user workflow.
This is therefore a separate research tool rather than a minor visual variation or version update.
DISTINGUISHING DESIGN
Many previous-period high and low tools focus on one or more of the following:
* Drawing horizontal lines only.
* Tested or untested status.
* Swept or unswept status.
* Previous-month levels.
* Range midpoints or equilibrium levels.
* Nearest-target labels.
* Directional bias.
* Historical reach or break rates.
* Trade-plan instructions.
This implementation instead combines:
* Four raw completed daily and weekly boundaries.
* A four-stage lifecycle for each boundary.
* Confirmed post-contact response measurements.
* Frozen-ATR normalization of outside and inside excursions.
* Daily and weekly range-intersection geometry.
* Contact-pair timing.
* A four-level hull.
* State breadth.
* Neutral confirmed-bar alerts.
* Scale-aware annotation collision management.
The common PDH, PDL, PWH, and PWL inputs are objective completed-period prices.
The distinguishing purpose of this implementation is the state, response, geometry, source-handling, and visualization framework built around those four boundaries.
LIMITATIONS
* OHLC bars do not reveal the exact tick-by-tick sequence inside a candle.
* The script does not invent an intrabar event order.
* Contact results depend on the selected Wick range, Candle body, or Close-to-close span definition.
* Contact results also depend on the selected tolerance.
* Multiple events confirmed on the same chart bar are simultaneous at chart resolution unless the available data proves otherwise.
* Sustained beyond is a configurable confirmed-close condition, not proof that a move will continue.
* Re-entered is a recorded return through a boundary, not proof of reversal.
* ATR-normalized values depend on the symbol's completed daily data and the selected ATR length.
* Current day and week range-use values are incomplete while the current period is developing.
* The first loaded day or week can contain partial history if the chart dataset begins after that source period started.
* Session definitions, holidays, early closes, broker feeds, exchange data, and ticker modifiers can change completed-period OHLC values.
* Synthetic charts can produce event timing different from standard market candles.
* Historical drawing retention is limited by the selected settings and TradingView object limits.
* The visual annotation rail can move when the visible chart window changes.
* The script provides no entries, exits, targets, stops, position sizing, probability forecasts, or performance claims.
OPEN-SOURCE IMPLEMENTATION
The script is written in Pine Script v6 using Pine built-ins and independently implemented state, measurement, and drawing logic.
It imports no external libraries.
The source is published openly so users can inspect the calculations and adapt the research settings within TradingView's rules.
Индикатор

Volatility Regime Tracker | NickJoanVolatility Regime Tracker | NickJoan
Core Idea
Volatility Regime Tracker measures the dispersion of price relative to its recent average and classifies the current market environment into distinct volatility states. Instead of just showing raw volatility values, the indicator uses percentile-based thresholds combined with moving average direction to identify three persistent regimes: LOW, NEUTRAL, and HIGH.
The script goes beyond simple volatility measurement by tracking how long each regime has lasted and comparing it to historical averages, giving you a statistical expectation for when the current regime might end.
The indicator can be used in two ways:
• As a volatility gauge, where you monitor the current volatility percentage and its trend.
• As a regime detection tool, where the background colors and duration table help you anticipate volatility state changes.
Calculation Logic
The indicator works through three main stages:
1. Volatility calculation
For the selected price source, the script first calculates the standard deviation over a user-defined lookback window. This absolute volatility is then normalized by the average price to produce a percentage-based measure.
• The script calculates the standard deviation of the source over the lookback period.
• It calculates the simple moving average of the source over the same period.
• It divides standard deviation by average price and multiplies by 100.
• It optionally annualizes the result using √365 for crypto daily charts.
This creates a coefficient of variation measure that shows how much price typically deviates from its recent average as a percentage.
2. Regime classification
The script then determines whether current volatility is high, low, or neutral relative to recent history.
• It calculates the percentile rank of current volatility over a regime lookback window.
• It compares this percentile to user-defined thresholds (default: 30th and 70th percentiles).
• It classifies volatility as HIGH (above upper threshold), LOW (below lower threshold), or NEUTRAL (between thresholds).
3. Dual confirmation
To reduce false signals, the script combines percentile ranking with moving average direction.
• It calculates a moving average of the volatility series.
• It checks whether current volatility is above or below this MA.
• It assigns regime states based on both percentile and MA direction.
This dual-confirmation approach produces five distinct visual states that map to three underlying regimes.
Background Color Logic
The script uses a two-layer color system to show both regime state and confidence level.
Strong signals (darker colors)
• Dark red: High percentile AND above MA (strong high volatility)
• Dark green: Low percentile AND below MA (strong low volatility)
Moderate signals (lighter colors)
• Light red: Neutral percentile but above MA (rising volatility)
• Light green: Neutral percentile but below MA (falling volatility)
Uncertain signals
• Gray: Percentile and MA direction disagree (conflicting signals)
This color structure allows you to distinguish between high-confidence regime readings and transitional or uncertain states.
Regime State Mapping
The indicator consolidates the five color states into three regime categories for duration tracking:
• LOW (0): Any green shade (dark or light) - volatility is low or falling
• NEUTRAL (1): Gray - volatility is in transition or conflicting
• HIGH (2): Any red shade (dark or light) - volatility is high or rising
This mapping ensures the duration statistics reflect the broader regime environment rather than short-term color fluctuations.
Duration Tracking Logic
The script continuously monitors regime changes and builds a historical record of how long each regime typically lasts.
Duration measurement
• When a regime change is detected, the script calculates how many bars the previous regime lasted.
• This duration is stored in an array specific to that regime type (LOW, NEUTRAL, or HIGH).
• The process repeats for each regime change, building a distribution of historical durations.
Statistical analysis
• The script calculates the average duration for each regime type from the stored history.
• It calculates the standard deviation of those durations.
• It computes confidence intervals at ±1 standard deviation (~68% confidence).
Real-time tracking
• The script counts how many bars the current regime has lasted.
• It displays this count alongside the historical average and confidence bounds.
• This allows you to see whether the current regime is typical, unusually short, or unusually long.
Duration Table Output
The table displays four rows of information for each regime type:
• Current bars in regime (if active) or "—" (if inactive)
• Historical average duration for LOW regimes
• Lower bound (average − 1 SD)
• Upper bound (average + 1 SD)
Interpretation
• If current bars < lower bound: regime is unusually short (may extend further)
• If current bars ≈ average: regime is typical (no strong expectation either way)
• If current bars > upper bound: regime is unusually long (may be nearing end)
Chart Output
The indicator displays three visual elements in a separate pane below the price chart:
Volatility line
• Shows the current annualized volatility percentage
• Plotted in blue for clear visibility
Moving average line
• Shows the smoothed volatility trend
• Plotted in gray with thicker linewidth
• Can be toggled off via input
Background color
• Shows the current volatility regime state
• Uses five color states mapped to three regimes
• Can be toggled off via input
Duration table
• Positioned at middle-right of the chart
• Shows current bars, average, and confidence intervals
• Can be toggled off via input
Inputs
The indicator has four main input groups.
CALCULATION
• Volatility Lookback (bars): defines the window used to calculate standard deviation. Default: 50.
• Annualize (√365): toggles annualization of volatility. Recommended for crypto daily charts.
• Source: selects the price series used in the calculation (default: close).
MOVING AVERAGE
• Type: chooses the MA type (SMA, EMA, WMA, RMA). Default: EMA.
• Length: sets the MA lookback period. Default: 30.
• Show Moving Average: toggles MA visibility on the chart.
VOLATILITY REGIME
• Regime Lookback (bars): defines the window used for percentile rank calculation. Default: 100.
• Low Threshold (percentile): sets the lower percentile boundary. Default: 30.
• High Threshold (percentile): sets the upper percentile boundary. Default: 70.
• Show Background Color: toggles regime coloring.
DURATION TABLE
• Show Duration Table: toggles the statistics table visibility.
• History Lookback (days): controls how many bars of history to use for average calculations. Default: 365.
Alerts
The script includes four alert conditions:
Volatility Regime Change
• Triggers on any regime transition (LOW → NEUTRAL, NEUTRAL → HIGH, etc.)
• Useful for monitoring all state changes
Low Volatility Regime
• Triggers when entering LOW regime (green background)
• Useful for breakout preparation or position size increase
Neutral Volatility Regime
• Triggers when entering NEUTRAL regime (gray background)
• Useful for identifying transition periods
High Volatility Regime
• Triggers when entering HIGH regime (red background)
• Useful for risk reduction or heightened awareness
How to Use It
This indicator is best used as a volatility filter and regime-aware positioning tool, not as a standalone entry signal.
Volatility regime filter
Use the regime colors to filter your trading approach:
• LOW regimes (green): Favor breakout strategies, increase position size
• HIGH regimes (red): Reduce position size, exercise caution (volatility can persist or reverse depending on market context)
• NEUTRAL regimes (gray): Wait for clearer signals or reduce exposure
Duration-based anticipation
Use the duration table to anticipate regime changes:
• If current bars approach upper bound: expect potential regime change soon
• If current bars are well below average: expect regime to continue
• If current bars exceed upper bound: regime is extended, watch for reversal
Trend confirmation
Use the volatility trend to confirm price action:
• Rising volatility (light red → dark red): confirms trend expansion or increased uncertainty
• Falling volatility (light green → dark green): confirms consolidation or stabilization
• Conflicting signals (gray): suggests uncertainty or transition
Practical Interpretation
Here is a simple way to read the results:
LOW regime (green)
• Price is tightly clustered around its average
• Volatility is below historical norms
• Often precedes breakout moves
• Good for trend-following entries
HIGH regime (red)
• Price is widely dispersed from its average
• Volatility is above historical norms
• Can indicate trending expansion, shock events, or panic conditions
• Reduce position size; assess whether context suggests continuation or reversion
NEUTRAL regime (gray)
• Volatility is transitioning or conflicting
• No clear regime signal
• Wait for clearer confirmation
Duration statistics
• Average: typical length of this regime type
• Lower/Upper bounds: normal range (~68% of cases)
• Current bars: where you are in the distribution
Best Use Cases
Typical uses include:
• Crypto volatility regime detection
• Position sizing based on volatility state
• Breakout vs. consolidation strategy filter
• Risk management and exposure control
• Multi-asset volatility comparison
• Regime-aware trade timing
It is especially useful when you want to objectively measure whether volatility is high or low relative to recent history, and whether the current regime is typical or extended.
Notes
The indicator is designed for daily crypto charts but works on any timeframe.
• Daily timeframe: "History Lookback (days)" represents calendar days
• Other timeframes: "History Lookback (days)" represents bars, not calendar days
The metric table is only as good as the selected lookback periods and thresholds.
• Shorter volatility lookback: more reactive but noisier
• Longer volatility lookback: smoother but may lag sudden changes
• Shorter regime lookback: faster regime detection but more whipsaws
• Longer regime lookback: more stable but slower to detect changes
• Tighter thresholds (e.g., 25/75): fewer regime changes, higher confidence
• Wider thresholds (e.g., 35/65): more regime changes, earlier detection
The Z-Score-style duration statistics are relative to the selected history window, so their meaning depends on how much data you include. Индикатор

Индикатор

VIX 3D Term Structure [MantisAlgo]VIX 3D Term Structure
VIX 3D Term Structure maps the live CBOE implied-volatility curve across six constant-maturity horizons: VIX1D, VIX9D, VIX, VIX3M, VIX6M, and VIX1Y.
TERM = Constant-maturity horizon from 1D to 1Y
TIME = Each tenor’s evolution over the latest nine trading days, from current to oldest
IV = Annualized implied-volatility level in VIX points
The indicator can be used on any chart symbol as a broad U.S. equity volatility context tool.
🌐 3D SURFACE
The lower pane displays the current VIX term structure with nine trading days of historical depth. Surface colors compare each tenor with its own selected daily average:
- 21 trading days — one month
- 63 trading days — one quarter (default)
- 126 trading days — six months
- 252 trading days — one year
Cooler colors indicate values below the selected average, while warmer colors indicate values above it. Camera rotation changes only the viewing angle and does not affect calculations.
📈 HISTORY RIBBON
The six VIX tenors are also plotted as 2D history on the active chart timeframe. Each line’s color reflects that tenor’s relative level versus its selected daily average.
📊 DASHBOARD
Curve Shape classifies the current back-minus-front term spread:
- 🟢 CONTANGO — the back tenor is more than 0.35 volatility points above the front tenor
- 🟠 FLAT — the back-minus-front spread is between −0.35 and +0.35 VIX points
- 🔴 BACKWARDATION — the front tenor is more than 0.35 volatility points above the back tenor
The dashboard also reports the six tenor values, Term Spread, 20-day annualized S&P 500 realized volatility, and the Implied–Realized Vol Spread calculated as 30-day VIX minus trailing SPX Realized Vol (20D).
Vol Level uses the median relative level of VIX9D, VIX, and VIX3M:
- 🟢 LOW VOL — 0.90 or lower
- 🟠 MID VOL — between 0.90 and 1.08
- 🔴 HIGH VOL — 1.08 or higher
⚙️ SETTINGS
Heat average length controls the historical baseline used for surface colors and Vol Level:
- 21 trading days — most responsive; useful for short-term volatility shifts, but more sensitive to noise
- 63 trading days — balanced short-to-medium-term baseline and the default
- 126 trading days — broader regime comparison with less sensitivity to temporary spikes
- 252 trading days — long-term annual context; slowest to react to recent regime changes
Changing this setting does not change the live tenor values or Curve Shape. It changes only how current volatility is classified relative to its historical baseline.
View rotates the 3D surface. Custom angle is applied only when Custom is selected. Dashboard selects the dashboard position on the price chart.
🧭 HOW TO USE
Use Curve Shape to read the front-to-back slope of the VIX term structure and the surface to track how each tenor has changed over the latest nine trading days.
Colors show whether each tenor is above or below its selected historical average. The surface provides volatility context rather than a directional price target.
🔔 ALERTS
Alerts fire when Curve Shape newly becomes BACKWARDATION or CONTANGO.
⚠️ DISCLAIMER
This indicator is provided for informational and educational purposes only and does not constitute financial or investment advice. VIX term structure describes option-implied volatility conditions and is not a direct directional signal for the charted asset. Historical conditions do not guarantee future results. All trading and investment decisions remain the sole responsibility of the user.
Индикатор

Market Regime: NQStatsMarket Regime — nqstats
A volatility-regime dashboard for NQ (and any symbol). It answers one question: is the market currently moving more, or less, than its own long-term normal — and is that changing? It does not predict direction. It describes the character and intensity of price movement, so you can size positions, place stops, and pick strategies that suit the current environment.
The methodology follows the market-regime framework described at nqstats.com/market_regimes. Big thanks to Chris for publishing this research and full credit to him for this concept. This indicator is simply an independent implementation of that concept, built for TradingView.
1. What it does
Markets cycle between calmer and more turbulent phases. A regime measure captures where you are in that cycle by comparing current volatility against a long-term baseline volatility:
- Ratio above 1.0 → Elevated regime. Moves are larger than normal.
- Ratio below 1.0 → Compressed regime. Moves are smaller than normal.
Knowing the regime matters because most strategies are implicitly tuned to a particular volatility environment. Running a breakout system in a compressed, range-bound regime — or a mean-reversion system in an elevated, trending one — is a common reason live results drift from a backtest. The indicator is a filter and a context tool, not a signal generator.
The output is a compact, monospace, monochrome table — there is no plotted line. That is deliberate: the regime is a daily-returns statistic, so the numbers are identical whether you view them on a 5-minute or a daily chart (see §2). A table reads cleanly on every timeframe; a plotted line would only be meaningful on the daily.
2. How it's calculated (and why)
Return series. It works from daily log returns: ln(close / previous close). Log returns are the standard choice for volatility work — they're additive across time and symmetric around zero. (A simple-returns toggle is provided if you prefer.)
Rolling volatility (the "now"). For each lookback window, it takes the standard deviation of those daily returns. A 10-day SD reflects the last ~2 weeks; a 50-day SD reflects the last ~2.5 months. Each is a snapshot of realized volatility at that horizon.
Baseline volatility (the "normal"). It takes the standard deviation of the same daily-return series over a long trailing window — several years — to represent the market's normal volatility across a full cycle. This is the denominator that defines "normal."
The regime ratio. rolling SD / baseline SD. Above 1 = louder than normal; below 1 = quieter than normal. This ratio is the heart of the framework.
Why standard deviation. Equity-index returns are skewed and fat-tailed, so it's fair to ask whether SD is the right scale. Two design choices handle this: the ratio is relative (rolling and baseline use the identical estimator, so most distributional distortion cancels in the division), and the extremeness read uses a percentile (see below), which is fully non-parametric and doesn't assume any distribution shape. SD is also what keeps this faithful to the reference methodology, and on the rolling side its sensitivity to large moves is a feature — a regime tool should react when a big move lands.
Why it's timeframe-independent. All calculations run on the daily series and are pulled onto your chart, so the table reads the same on any timeframe. This avoids a subtle trap: an intraday return SD is far smaller than a daily one, so comparing intraday volatility against a daily baseline would read "compressed" almost permanently. Keeping numerator and denominator in the same daily units is what makes the ratio meaningful.
Percentile (how extreme). For each lookback, the current rolling SD is ranked against its own history over the baseline window (0–100). A ratio tells you how far from normal; the percentile tells you how rare. A reading of 0.90 at the 5th percentile is a much bigger deal than 0.90 at the 40th. Because it's a rank, it's robust to skew and fat tails.
Compression trend. The change in the ratio over a short trend window tells you which way volatility is moving — whether compression is building (ratio falling) or easing (ratio rising).
A note on estimators: both the rolling and baseline standard deviations use the same population formula, so the two sides of the ratio are always measured identically.
3. Inputs and how to configure them
Regime
- Log returns — on by default. Turn off to use simple percentage returns.
- Lookback 1 / 2 / 3 (bars) — the three rolling windows, in daily bars. Defaults 10 / 20 / 50. These are your short, medium, and long horizons. Note "bars" here means trading days, since the calc runs on the daily series.
Baseline
- Baseline lookback (years) — how many years define "normal." Default 10. Longer = a more stable baseline that includes a fuller cycle (calm stretches and crises alike). Shorter = a baseline that reflects only recent conditions and updates faster. This single input has the largest effect on your readings: a baseline drawn only from a calm period will make current conditions look elevated, while one that includes major volatility events will make the same conditions look compressed. If you want to line up with an external reference, adjust the years until your BASE SD matches theirs.
Trend
- Trend window (days) — how far back the compression trend looks. Default 5. Smaller = more responsive; larger = smoother.
- Trend deadband (ratio) — how much the ratio must move before the trend is called BUILD or EASE rather than HOLD. Default 0.05. Widen it if the trend feels twitchy; tighten it if it sits on HOLD too often.
Table
- Text colour — applied to the whole table (monochrome by design).
- Location — nine on-chart positions.
- Text size — Tiny to Huge; scales the whole table.
4. What the table shows
Columns:
- LOOKBACK — the rolling window (e.g. 10d, 20d, 50d).
- STATE — Elevated (ratio > 1) or Compressed (ratio < 1). Binary at 1.0, matching the reference framework.
- RATIO — rolling SD ÷ baseline SD. The core number.
- %ILE — where current volatility ranks in its own multi-year history. Near 0 = calmer than almost any point in the window; near 100 = hotter than almost everything.
- COMPR — the compression trend: BUILD (compression increasing / volatility contracting), EASE (compression releasing / volatility expanding), or HOLD (inside the deadband).
- ROLLSD — the raw rolling standard deviation, for reference and for comparing against external sources.
Rows:
- One row per lookback.
- OVERALL — a headline read taken from the medium (20d) horizon: COMPRESSING, EXPANDING, or STABLE.
- BASE SD / BARS — the baseline standard deviation and the number of daily bars it was built from (≈ 252 × your years setting). Use BARS to confirm the baseline loaded the history you expect.
5. How to read it
Start with STATE and RATIO. Above 1 means the market is printing larger-than-normal moves (elevated); below 1 means smaller-than-normal (compressed). This says nothing about direction — only about how much the market is moving.
Read the lookbacks as a timeline, not three separate numbers. Because each window only "sees" its own recent slice, the shape across horizons tells a story. When the short window reads lower than the long one (e.g. 10d compressed while 50d still elevated), a volatility event from weeks ago is still inside the long window but has already rolled out of the short one — volatility is decreasing and compression is building. The reverse ordering means the front end is heating up. The shortest lookback always moves first, so watch it as your leading tell.
Use the percentile for extremeness. A compressed reading in the low single-digit percentiles means the market is near its quietest in years — historically these deep-compression phases tend to resolve, sometimes abruptly. A high percentile means an unusually loud environment.
Use COMPR and OVERALL for direction. BUILD means the coil is winding tighter; EASE means it's releasing. The first lookback to flip to EASE is your earliest heads-up that a compression is breaking.
Turning it into decisions (following the reference framework's guidance):
- Elevated regime — expect larger, more extended moves. Stops are better placed wider to accommodate the range, and position size reduced accordingly. Trend and continuation approaches tend to work better here.
- Compressed regime — the market tends to mean-revert and range. Breakout and trend strategies are less reliable. Realized volatility is low, so stops can often be tighter — but remember compression doesn't last, and it can release quickly.
- As a filter — before taking a trade, check that the strategy you're about to use suits the regime you're actually in. This is the single most valuable use of the tool.
Notes
- Built with NQ in mind but works on any symbol with sufficient daily history.
- Requires enough loaded history for the baseline; if BARS reads far below years × 252, extend your chart history or reduce the baseline years.
- This is an analysis tool, not financial advice, and does not generate buy/sell signals. Regimes describe volatility conditions; they do not predict direction.
- Concept credit: the market-regime framework at nqstats.com/market_regimes. This is an independent implementation. Индикатор

Daily High & Low Time Map (HOD / LOD)Daily High & Low Time Map
What it does
This indicator counts, across the completed trading days that your chart has loaded, which time window of the day produced the daily high and which produced the daily low. The result is a two-row heat strip in its own pane, lined up in time under the running day, plus a dashboard that answers the one question that actually matters intraday: at this hour, in how many of the past days was the final high still ahead? Every number carries its sample size, so you can see when a bright cell stands on three days instead of three hundred.
How it works
The script walks the chart bar by bar, never leaves the timeframe you are on and never requests data from a higher timeframe. A day is a span between two anchor points that you choose; inside that span each confirmed bar can move the running high and low. The time bucket of an extreme is taken from the opening time of the bar that produced it, so a later part of the day can never move an earlier reading.
A day is closed on the first bar of the next day and written once into a ring buffer; the running day is never part of the statistics.
The bucket index comes from the bar opening time in the anchor timezone, which follows daylight saving. The repeated hour of the autumn change stays inside the same day, which is capped at 100 % coverage instead of counting as an error.
Days below the coverage threshold - half days, data gaps, the clipped first day of a replay - are dropped and reported as skipped instead of silently diluting the counts.
Filters for weekday, day type and sample window are applied while counting; stored days are never modified. Shares carry a Wilson score interval, which stays inside 0 to 100 % even when a bucket holds no hits or every hit.
How to use it
Add the script. It opens in its own pane below the chart.
Pick the day definition that matches the instrument: midnight New York for index and FX charts, the 18:00 anchor for CME futures, the 09:30 anchor when only the cash session interests you, midnight UTC for symbols that trade around the clock.
Read the upper row of the strip as "how often the daily high was made here" and the lower row as the same for the daily low. Brighter means more often.
Read the dashboard line "High still ahead" as a conditional share over completed days, never as a statement about today.
If the cells look pale and the note says the sample is small, widen the slot or load more history before you read anything into them.
What makes it original
Time-of-day statistics for highs and lows exist, and so do session boxes; what this script does differently is refuse to hand out a number without the evidence behind it. Every share is printed with the sample it came from and with a Wilson confidence interval, so a bucket built from eleven days does not read like one built from two hundred. Days are admitted only when they carry enough bars to be comparable, and the dropped ones are counted in plain sight. The map is a strip of buckets rather than a table, because the question is a shape. The conditional row extends the same idea forward: given the time of day, how much of the day's high-making is still ahead - again with the sample attached.
Inputs
Behaviour:
Day definition - where a trading day starts: Midnight New York, Futures 18:00 NY, RTH 09:30 NY or Midnight UTC. Session windows use the same timezone, and an evening session is labelled by the calendar day it ends on.
Slot width - 15, 30 or 60 minutes. A bucket narrower than one chart bar is raised automatically and the dashboard says so.
Min day coverage % - a day counts only with at least this share of the bars of the fullest day on the chart. Range 10-100, default 60.
Last N days - size of the ring buffer. Range 5-1000, default 250.
Tie rule - which occurrence wins when the same price is reached twice in a day.
Use start date and Start date - restrict the sample to days after a fixed date. Off by default.
Mon , Tue , Wed , Thu , Fri - on by default. Sat and Sun - off by default. Auto-include weekends for 24/7 symbols - on by default; crypto includes both anyway.
Day type - all days, or only those that closed above or below their open.
Asia , London KZ , NY AM KZ , Lunch , NY PM KZ - session windows, one dashboard row each; a bucket counts when any part of it falls inside. NY AM KZ drives the session-start alert.
Show Silver Bullet rows - three fixed one-hour rows. Off by default.
Count current slot as still open - whether a day whose extreme fell into the current bucket counts as ahead. On by default.
Ahead alert threshold % - level at which the ahead alert fires. Range 1-99, default 25.
Ramp scaling - relative to the busiest bucket, or a fixed scale so two symbols can be compared.
Strip mode - both rows, high only, low only, or one combined row counting either extreme.
Presentation: whether the strip, dashboard, live row, Wilson bounds, sparkline, session rows and the H and L markers are drawn, the dashboard corner and text size, the marker size and background, the two colour ramps and the theme.
Signals and alerts
Entering high-frequency high slot - fires on bar close when price enters the bucket that held the daily high most often in the current sample.
Entering high-frequency low slot - the same for the daily low.
Ahead alert - fires on bar close the first time the share of days with a later high falls below the threshold.
Session start - fires on the first bar inside the NY AM window.
New running day extreme - fires on bar close when the running high or low of the day has moved.
The first three depend on the aggregation, which is evaluated on the most recent bar. They are meant for live use; on historical bars they stay silent.
Repainting
Every state change happens on a confirmed bar. The running day is written into the sample only on the first bar of the next day, so the current day never influences a count. The bucket of an extreme is taken from the opening time of the bar that made it and is stored once; nothing rewrites it later. There is no request for a higher timeframe and no lookahead, so a reload and a bar replay produce the same numbers.
Limitations
The map is suppressed above a certain timeframe and whenever the chart bar does not divide the bucket width - on a daily chart every day is one bar, and on a 45-minute chart with 60-minute buckets some buckets get twice as many bars. The strip stays empty and the note line says why. Use a minute timeframe that divides the bucket width.
The sample is the loaded chart history, nothing more: at 20 000 bars roughly 14 days on 1-minute futures, 51 on a 1-minute regular-hours stock chart, 72 on 5-minute futures, 256 on 5-minute regular hours, 217 on 15-minute futures, 430 on 30-minute and 870 on hourly. The dashboard prints the number it has.
Small samples move. Below 30 days the cells are dimmed on purpose, and a share out of ten days is a number, not a finding.
Buckets the chart has no bars for - the night hours of a regular-hours stock chart - stay dark. That is missing data, not a measurement.
On a 1-minute chart the strip cannot be drawn more than 500 bars into the future; the dashboard reports how many buckets were left out.
It describes the past of one symbol on one chart and says nothing about where today's high will be.
This script is a charting tool for educational purposes. It does not provide financial advice and does not predict future price movement. Trading carries risk; decisions and their outcome remain yours. Индикатор

Custom Footprint [Auto-Scale & Filter]This indicator provides a functional approximation of a Footprint Chart within TradingView by extracting lower timeframe (LTF) data and visualizing the bid/ask volume distribution directly inside the current candles.
While TradingView's Pine Script has a hard limit on the number of labels (maximum 500) that prevents a full historical footprint mapping, this script bypasses structural limitations using smart auto-scaling and historical offsetting.
Key Features:
Auto-Scaling by Asset: Uses ATR to automatically calculate the optimal price bin step. Whether you are viewing Crypto, Forex, or Indices, the script adjusts itself to maintain readable density without cluttering the screen.
Volume Filtering: Includes a minimum volume filter. Price levels with total volume below your specified threshold will not be rendered, allowing you to focus on high-liquidity nodes and true absorption.
Customizable Visuals: You can customize the buy/sell delta text colors, toggle the label backgrounds on or off, and adjust background opacity so the numbers remain clearly visible over the candles.
History Offset: Due to the 500-label limit, the script limits visibility to the most recent candles. To view the footprint of older price action, simply increase the "Bar Offset" in the settings to shift the focus window backward.
How to Use:
Apply it to your chart and set the "Lower Timeframe" in the settings. (If you are on a Premium plan, using "1S" or "5S" will provide highly granular tick-level approximations. Otherwise, "1" minute is recommended).
Adjust the "Min Volume Filter" based on the asset's average volume to clean up noise.
Toggle "Show Background" depending on your chart theme for better visibility.
Limitations:
This is not a native order flow footprint chart. It estimates bid/ask by evaluating if the LTF close was higher or lower than its open.
Cannot display footprint data for the entire chart history at once due to Pine Script’s rendering limits. Use the "Offset" feature to inspect past structure.
I built this tool to provide a practical workaround for order flow traders relying on Pine Script. Feel free to adjust the settings to fit your preferred assets and trading style.
Feel free to modify the code however you like. Индикатор

Индикатор

Daily Levels + Score# Daily Levels + Score (DHL×2)
---
## WHAT IT DOES
Most support/resistance scripts draw every level they find and leave you to guess which ones matter. DHL×2 finds the daily highs and lows that cluster together, draws them on your intraday chart, and then **grades each level with a statistical effectiveness score** based on how price actually reacted to it — evaluated strictly out-of-sample, so a level never "confirms itself". It also maps the current premium/discount context of the range with a time-at-price profile (POC / VAH / VAL).
## HOW IT WORKS
**1. Level detection — density clustering (KDE).**
Daily highs and lows over the lookback window are grouped with a kernel density estimate (triangular kernel, bandwidth = tolerance). Levels are the peaks of that density, so the result does not depend on the order in which candles are scanned, unlike the usual greedy grouping. Each touch is weighted by recency, and the final level is the weighted average of its touches. Tolerance adapts to volatility: Parkinson (default, converges faster after regime changes) or ATR.
**2. No self-confirmation bias.**
The touches that *form* a cluster do not count as tests. A cluster is "born" once it gathers the minimum number of touches; everything after that candle is out-of-sample evaluation. This is the key difference from scripts that count the same touches twice — once to build the level and again to "prove" it works.
**3. Effectiveness score.**
From its birth onward, every approach to the level is classified as respected or broken (consecutive candles in the zone count as one event). Three score modes:
- **Wilson 95%** — lower bound of the confidence interval; small samples are pushed toward 0 instead of showing a misleading "100% (2/2)".
- **Bayes (shrinkage)** — empirical Bayes: each level's score is pulled toward the base rate of all levels on the chart, with a configurable prior strength.
- **Raw %** — no correction, for comparison.
On top of that:
- **Time decay** — a respect from 30 days ago weighs less than yesterday's (configurable half-life).
- **Liquidity-consumption penalty** — consecutive respected tests progressively weaken the score, mimicking how resting orders get consumed at a real level.
- **Bounce magnitude (MFE)** — the average favorable excursion after each respect, expressed in daily-volatility multiples (σ), shown next to the score.
**4. Confluence.**
Round numbers (●, step configurable: e.g. 100 for NQ, 25 for ES) and proximity to the range equilibrium (◆) add a score bonus.
**5. Premium / Discount + time-at-price profile.**
The selected range (previous day, last N days, or full lookback) is split with fib lines (0 / 25 / 50 / 75 / 100) and an equilibrium line. A TPO-style **time-at-price profile** (no volume needed) is built from chart-resolution bars inside the range and plots the **POC, VAH and VAL**. When the POC sits meaningfully away from the geometric equilibrium (threshold as % of the range), the status label flags the imbalance with its direction: **POC>EQ** (p-shaped, value built in premium) or **POC Индикатор

MAD Volatility Trail [BackQuant]MAD Volatility Trail
Overview
MAD Volatility Trail is a robust trend-following overlay built from a rolling median and Median Absolute Deviation rather than a conventional moving average and standard deviation.
The indicator estimates a central price using the rolling median, measures how widely recent prices are distributed around that median using MAD, converts that dispersion into adaptive upper and lower bands, and then transforms those bands into one-sided trailing boundaries.
The result is a persistent bullish or bearish trend regime with:
A robust median-based center.
MAD-derived volatility bands.
Optional ATR minimum band width.
One-sided trailing support and resistance.
Optional median-slope confirmation.
Bullish and bearish regime flips.
Strength-reactive gradient and glow.
Post-flip bloom visualization.
Trend-coloured candles.
Signal and alert support.
The main distinction is statistical.
Most volatility trails rely on:
Means.
Standard deviation.
ATR.
MAD Volatility Trail instead uses:
Median.
Median Absolute Deviation.
Median-based statistics are substantially less sensitive to isolated extreme observations, making the framework useful when the user wants a trend structure that is less influenced by individual spikes or outliers.
Core concept
The indicator separates the problem into four stages:
Estimate a robust rolling center using the median.
Measure robust dispersion around that center using MAD.
Build upper and lower adaptive deviation bands.
Convert those raw bands into persistent trailing trend boundaries.
The resulting trail behaves conceptually like a volatility-aware regime filter, but its volatility estimate comes primarily from the empirical distribution of price around its median.
Why median instead of mean?
A conventional arithmetic mean is calculated by summing all observations and dividing by their count.
Every value directly affects the result.
This makes the mean sensitive to outliers.
Consider a simplified sample:
100
101
101
102
150
The extreme value at 150 pulls the arithmetic mean upward substantially.
The median is simply the middle observation after sorting:
Median = 101
The single extreme observation has much less influence.
This property is called robustness .
In markets, isolated large candles, gaps, liquidation events and temporary price spikes can distort mean-based statistics. Median-based calculations intentionally reduce the influence of those individual observations.
Rolling median
For each bar, the indicator collects the selected Source values across the MAD Lookback.
It then calculates the exact median of the available observations.
For an odd number of observations, the median is the middle sorted value.
For an even number, the median lies between the two central observations according to the median implementation.
The resulting value becomes the statistical center of the trail.
Unlike an EMA or RMA, the median is not recursively smoothed.
It is recomputed from the actual distribution of values inside the current rolling window.
Early-history behaviour
At the beginning of the chart, the script ignores unavailable historical values.
This means the first valid median calculations may use fewer observations than the full MAD Lookback until sufficient chart history has accumulated.
Once the complete lookback is available, the calculation uses the full selected window.
Median Absolute Deviation
After calculating the rolling median, the script measures the absolute distance of every observation from that median:
Absolute Deviation = |Value - Median|
It then takes the median of those absolute deviations:
MAD = Median(|Xi - Median(X)|)
This is the Median Absolute Deviation .
MAD measures the typical distance of observations from the median.
It serves a role similar to standard deviation, but the mathematics and statistical behaviour are different.
Why MAD is robust
Standard deviation squares deviations from the mean.
Large deviations therefore receive disproportionately large influence.
A single extreme observation can:
Move the mean.
Create a very large squared deviation.
Increase the final standard deviation substantially.
MAD does not square deviations.
It calculates absolute distance and then takes another median.
Extreme values therefore have limited ability to change the result unless enough of the underlying sample shifts.
This gives MAD a high resistance to outliers.
In practical chart terms, one unusual wick or shock candle is less likely to inflate the statistical width as dramatically as it could under a standard-deviation model.
MAD versus standard deviation
The two measures answer related but different questions.
Standard deviation
Measures squared dispersion around the arithmetic mean.
MAD
Measures median absolute dispersion around the median.
Standard deviation is highly useful when a mean-and-variance framework is desired.
MAD is useful when robustness to unusual observations is more important.
The indicator does not claim one is universally superior.
It intentionally uses MAD because the purpose is to construct a robust trend boundary.
MAD Scale
Raw MAD is not numerically identical to standard deviation.
Under a normal distribution, MAD is usually multiplied by a consistency factor of approximately 1.4826 when the goal is to make it comparable to standard deviation.
The indicator exposes this scaling directly:
Robust Deviation = Raw MAD × MAD Scale
The script default is 1.4655.
The input remains fully adjustable, so users who want the conventional normal-consistency approximation can set the factor near 1.4826.
This scale does not change the median itself.
It changes only the size of the deviation estimate used to build the bands.
Deviation Factor
After scaling MAD, the indicator applies the Deviation Factor:
MAD Width = Scaled MAD × Deviation Factor
This acts as the main sensitivity control.
Lower values:
Create narrower raw bands.
Place the trail closer to price.
Produce more frequent regime changes.
Higher values:
Create wider bands.
Require larger movement for reversals.
Produce more persistent trend states.
The MAD Scale and Deviation Factor both affect width, but they represent different concepts.
MAD Scale calibrates the statistical dispersion estimate.
Deviation Factor determines how much of that estimated dispersion is used for the trend envelope.
Raw MAD bands
The raw bands are:
Upper MAD Band = Median + Band Width
Lower MAD Band = Median - Band Width
Before trailing logic is applied, these bands can move freely upward or downward with:
The rolling median.
MAD dispersion.
Any active ATR floor.
These are statistical envelopes around the median.
They are not yet the final trend trail.
ATR Minimum Width
MAD can become extremely small when recent prices are tightly clustered.
In very low-dispersion conditions, this may place the raw bands extremely close to the median.
That can create excessive sensitivity to minor price fluctuations.
The optional ATR Minimum Width provides a secondary floor.
The script calculates:
ATR Floor = ATR(ATR Length) × ATR Floor Multiplier
When enabled:
Band Width = max(MAD Width, ATR Floor)
This means MAD remains the primary volatility model, but the bands cannot contract below the selected ATR-based threshold.
Why use an ATR floor?
MAD and ATR measure different aspects of market behaviour.
MAD measures:
Dispersion of the selected source around its rolling median.
ATR measures:
Bar-to-bar trading range.
Gaps relative to the previous close.
A market can have:
Low median dispersion.
But still produce meaningful intrabar range.
The ATR floor can prevent the trail from becoming unrealistically tight under those conditions.
ATR floor disabled
With ATR Minimum Width disabled, the entire structural width comes from:
MAD × MAD Scale × Deviation Factor
This produces the purest MAD-based version of the indicator.
ATR Length
ATR Length controls the volatility horizon used only for the optional minimum-width calculation.
It does not affect:
The rolling median.
Raw MAD.
Scaled MAD.
Note that the visual glow and bloom later in the script use a fixed ATR(14), separate from this ATR Length input.
Trailing bands
The raw MAD bands are converted into one-sided trails.
This is the stage that turns a statistical envelope into a persistent trend system.
Two independent trails are maintained:
Lower Trail.
Upper Trail.
Lower Trail
When the previous trigger remains above the previous Lower Trail, the new Lower Trail is:
max(Current Raw Lower Band, Previous Lower Trail)
This means the Lower Trail can:
Move upward.
Remain unchanged.
But cannot move downward while the condition remains active.
This creates a ratcheting support structure.
If the trigger falls below the prior Lower Trail, the trail is allowed to reset to the new raw lower band.
Upper Trail
When the previous trigger remains below the previous Upper Trail, the new Upper Trail is:
min(Current Raw Upper Band, Previous Upper Trail)
This means the Upper Trail can:
Move downward.
Remain unchanged.
But cannot move upward while the condition remains active.
This creates a ratcheting resistance structure.
If the trigger rises above the previous Upper Trail, the band can reset to the current raw upper value.
Why trailing the bands matters
A raw median-deviation envelope moves in both directions.
If those raw bands were used directly for trend changes:
The threshold itself could retreat toward price.
Small changes in median or MAD could produce unstable reversals.
The one-sided trail introduces hysteresis .
Hysteresis means that once a trend regime is established, the threshold required to reverse it remains on the opposing side.
This reduces the tendency to flip repeatedly around the rolling median.
Flip Trigger
The user can choose which series is used when evaluating trail breaks:
Close.
Source.
Close
Uses the candle close regardless of which series is used for the MAD calculation.
This is the conventional option.
Source
Uses the selected Source input.
For example, if HLC3 is selected as the Source:
The median is calculated from HLC3.
MAD is calculated from HLC3.
The trail can also be triggered by HLC3.
This keeps the center, dispersion and reversal trigger based on the same source.
Initial trend state
The trend begins in a neutral state.
Once a valid rolling median is available:
Trigger at or above Median = bullish initialization.
Trigger below Median = bearish initialization.
This initial assignment is not treated as a bullish or bearish flip.
Flip signals occur only after the indicator has already established one regime and later transitions into the opposite regime.
Bullish flip
A bullish regime change requires:
Trigger to move above the Upper Trail.
Current trend not already bullish.
Optional bullish median-slope confirmation to pass.
Once confirmed:
Trend becomes bullish.
The Lower Trail becomes the active trend boundary.
A bullish signal can be displayed.
Bearish flip
A bearish regime change requires:
Trigger to move below the Lower Trail.
Current trend not already bearish.
Optional bearish median-slope confirmation to pass.
Once confirmed:
Trend becomes bearish.
The Upper Trail becomes the active boundary.
A bearish signal can be displayed.
Active trend trail
The final displayed trend boundary depends on the regime:
Bullish = Lower Trail.
Bearish = Upper Trail.
This means the line automatically moves to the opposite side of price when a complete regime change occurs.
Median Slope Confirmation
The optional Median Slope Confirmation adds a directional requirement to trend reversals.
For a bullish flip:
Current Median > Median from Slope Lookback bars ago
For a bearish flip:
Current Median < Median from Slope Lookback bars ago
This requires the robust statistical center itself to move in the direction of the proposed new trend.
Why confirm with median slope?
Price can briefly cross a trail while the underlying median remains flat or continues moving in the opposite direction.
Slope confirmation can reject some of these events.
For example:
A bullish trail break with a still-falling median may represent:
A temporary rebound.
A liquidity sweep.
Noise inside a larger bearish structure.
Requiring the median to rise adds another layer of confirmation.
The trade-off is lag.
A genuine reversal may cross the trail before the rolling median has clearly changed direction.
Slope Lookback
Slope Lookback controls how far back the median is compared.
Lower values:
Respond more quickly.
Require only a very local median turn.
Higher values:
Require a broader directional shift.
Produce stronger confirmation.
Can delay reversals.
This same lookback is also used in the visual slope-strength calculation even when slope confirmation itself is disabled.
Break Trail On Flips
When enabled, the displayed trail is temporarily hidden on the actual regime-flip bar.
This creates a visual break between:
The previous regime’s trail.
The new regime’s trail.
Without the break, the plotting engine can draw a connecting segment from one side of the market to the other.
That connection has no analytical meaning.
Break Trail On Flips affects visualization only.
It does not affect:
Trend state.
Raw bands.
Trail calculations.
Signals.
Robust trend structure
The complete structural model can therefore be summarized as:
Rolling Median determines robust center.
MAD determines robust dispersion.
MAD Scale calibrates the dispersion.
Deviation Factor determines band distance.
Optional ATR floor prevents excessive compression.
Raw bands form the initial envelope.
Ratchet logic creates trailing support and resistance.
Opposite-trail breaks determine regime changes.
Optional median slope confirms those reversals.
This combination is what separates the indicator from simply plotting median ± MAD.
Visual strength model
The script calculates a separate Trend Strength value used only to control the presentation of the gradient and glow.
It does not alter:
Trend direction.
Trail levels.
Flip conditions.
Trend Strength combines:
Price distance from the active trail.
Absolute rolling-median slope.
Distance Strength
The script first measures:
Trail Distance = |Close - Active Trail|
This is normalized by the current band width.
The normalized distance is capped when price reaches twice the active band width away from the trail.
Conceptually:
Close to trail = low distance strength.
Far from trail = high distance strength.
This reflects how separated price is from the current structural boundary.
Slope Strength
The indicator also measures:
|Current Median - Median |
This value is normalized by the current band width and capped at one.
The purpose is to compare median movement against the current statistical width.
A steep median relative to the band width produces stronger visual slope strength.
Combined Trend Strength
The final visual strength is:
70% Distance Strength.
30% Median Slope Strength.
and is capped at one.
The distance component receives greater weight because the visual system places more emphasis on how strongly price is separated from the active trail.
Again, this number is not a probability, forecast or additional signal.
It is a visual intensity measure.
Layered gradient
The area between the active trail and current close is divided into several intermediate levels.
The script creates reference points approximately:
15% of the distance from trail to price.
35%.
60%.
82%.
Then the final segment to price.
These create five layered gradient regions.
The layers become progressively more transparent as they move away from the trail.
This gives the trail visual depth without turning the entire area between price and structure into one solid block.
Gradient direction
The geometry of the gradient is determined by whether close is above or below the active trail.
The colour itself comes from the current bullish or bearish trend regime.
The gradient therefore visualizes:
The active trend colour.
The distance between price and trail.
The relative strength of the trend visualization.
The gradient does not determine the regime.
Trend-strength gradient response
Higher Trend Strength reduces transparency in several layers.
This makes the ribbon more visible when:
Price is strongly separated from the trail.
The rolling median is moving meaningfully.
Lower strength produces a softer appearance.
This allows the visual presentation to communicate more than simple bullish or bearish state.
Flip bloom
The indicator includes a temporary post-flip bloom.
The bloom is derived from the number of bars elapsed since the most recent bullish or bearish transition.
Importantly, in the current implementation the bloom begins after the flip bar:
Flip bar: no bloom boost.
1 bar after flip: maximum bloom.
2 bars after flip: reduced bloom.
3 bars after flip: smaller residual bloom.
Afterward: bloom disappears.
The relative bloom strengths are:
1.00
0.55
0.25
This emphasizes the early bars following a newly confirmed regime change.
Why bloom after the flip?
The flip itself can optionally contain a break in the trail.
Applying the bloom to the following bars emphasizes the newly established active trail rather than drawing a large effect around a temporarily hidden flip point.
The bloom is cosmetic.
It does not modify the underlying calculations.
Trail glow
The active trail can also display a persistent glow.
Glow width is based on:
ATR(14) × a factor that increases with Trend Strength
This ATR(14) is fixed for visualization and is independent of the user-selected ATR Length used by the optional minimum-width floor.
The glow therefore becomes slightly wider as visual trend strength increases.
Two layers are used:
A tighter inner glow.
A broader outer glow.
The inner glow responds more strongly to Trend Strength and post-flip bloom.
Rolling Median display
The rolling median can be displayed independently from the trail.
This is useful for studying the difference between:
The current robust center.
The statistical raw bands.
The ratcheting trend trail.
During a bullish regime, the active Lower Trail can remain below the rolling median.
During a bearish regime, the active Upper Trail can remain above it.
The median is not itself the trend signal.
Raw MAD Bands display
The raw upper and lower MAD bands can also be shown.
These lines make it easier to see how the trailing logic differs from the unrestricted statistical envelope.
Raw bands:
Can move in either direction.
Trailing bands:
Can ratchet in only one direction while their persistence condition remains active.
The gap between raw and trailing levels illustrates the hysteresis introduced by the trend logic.
Trend candles
The script can redraw candles on the main chart using the active trend colour.
Bullish regime:
Uses the selected Bullish colour.
Bearish regime:
Uses the selected Bearish colour.
The candle colour represents the persistent trail regime, not whether each individual candle closed higher or lower.
A bearish candle can therefore remain bullish-coloured while the broader MAD Trail regime remains bullish.
Signal markers
Bullish and bearish markers appear only on complete transitions between established regimes.
A bullish marker requires:
Previous trend = bearish.
Current trend = bullish.
A bearish marker requires:
Previous trend = bullish.
Current trend = bearish.
Initial trend assignment does not generate a flip marker.
How to interpret the indicator
Bullish regime
A bullish state means price has previously broken above the opposing Upper Trail and the Lower Trail is now active.
The Lower Trail can be interpreted as:
Dynamic trend support.
A structural invalidation reference.
A trailing regime boundary.
Bearish regime
A bearish state means price has broken below the opposing Lower Trail and the Upper Trail is active.
The Upper Trail can be interpreted as:
Dynamic resistance.
A bearish invalidation reference.
A trailing regime boundary.
Price close to trail
When price approaches the active trail:
Visual distance strength decreases.
The gradient becomes softer.
The market is closer to the regime boundary.
This does not guarantee a reversal.
A healthy trend can repeatedly retest its active trail.
Price far from trail
When price moves substantially away:
Distance Strength rises.
The visual effect becomes stronger.
This indicates greater separation from the active structural boundary.
It should not automatically be interpreted as a better entry.
A market can be strongly extended and simultaneously close to exhaustion.
Median and trail rising together
During a bullish regime, a rising median combined with a rising Lower Trail indicates:
The robust center is moving upward.
The structural support boundary is also advancing.
This represents cleaner directional alignment.
Median flattening while trail remains bullish
The persistent regime can remain bullish while the median begins flattening.
This indicates:
The trend has not yet been invalidated.
But the robust center is no longer advancing as strongly.
The visual slope-strength component may weaken under this condition.
Raw band expansion
If MAD increases:
Raw bands widen.
Trail reset levels can move farther away.
This means recent source values are becoming more dispersed around the median.
Raw band contraction
If MAD falls:
The raw envelope tightens.
If the ATR floor is disabled, the structure can become substantially narrower.
If the ATR floor is enabled, contraction stops once the selected minimum width is reached.
How to use the indicator
1. Trend regime filter
Use the persistent trail state as directional context:
Bullish trail regime = prioritize long-side setups.
Bearish trail regime = prioritize short-side setups.
The trail does not define a complete trading system by itself.
2. Pullback structure
During a bullish regime, the Lower Trail can provide a dynamic reference for deeper pullbacks.
During a bearish regime, the Upper Trail can provide a reference for rallies.
The farther price moves from the trail, the greater the current structural separation.
3. Regime transitions
Bullish and bearish flips identify moments when price has crossed completely through the opposing robust-deviation trail.
These may be used as:
Trend-change alerts.
Confirmation for another entry method.
Potential exit conditions.
4. Median confirmation
Users who want more selective signals can enable Median Slope Confirmation.
This can be especially useful when:
The market is choppy.
Price frequently sweeps through statistical boundaries.
5. Pure robust-volatility mode
Disable the ATR Minimum Width to make band width depend only on:
Rolling MAD.
MAD Scale.
Deviation Factor.
This produces the purest version of the model.
6. Hybrid robust-volatility mode
Enable ATR Minimum Width when the MAD channel becomes too narrow for the instrument or timeframe.
This preserves MAD as the primary engine while adding a conventional range-based safety floor.
Input guide
Source
Series used for the rolling median and MAD calculation.
MAD Lookback
Controls the number of observations used for the rolling median and dispersion estimate.
Shorter values adapt faster.
Longer values create a broader and more stable distribution.
MAD Scale
Multiplier applied directly to raw MAD.
The commonly cited normal-distribution consistency factor is approximately 1.4826; the script default is 1.4655.
Deviation Factor
Controls the final width of the MAD envelope.
ATR Minimum Width
Prevents the active band width from falling below an ATR-derived floor.
ATR Length
Controls the ATR used by the optional floor.
ATR Floor
Controls the minimum width as a multiple of ATR.
Median Slope Confirmation
Requires the rolling median to move in the direction of a proposed trend flip.
Slope Lookback
Controls how far back the current median is compared.
It also influences the visual slope-strength calculation.
Flip Trigger
Selects Close or Source for trail-break detection.
Break Trail On Flips
Creates a visual discontinuity on transition bars.
How this differs from a standard Supertrend
A conventional Supertrend generally uses:
A price midpoint such as HL2.
ATR as the full band-width model.
MAD Volatility Trail instead uses:
Rolling median as its center.
Median Absolute Deviation as its primary width.
ATR only as an optional minimum floor.
The trail mechanics are conceptually related, but the statistical foundation is different.
How this differs from Bollinger Bands
Bollinger Bands normally use:
A moving average.
Standard deviation.
Symmetrical raw bands.
MAD Volatility Trail uses:
Rolling median.
Median Absolute Deviation.
One-sided trailing bands.
Persistent trend-state logic.
Bollinger Bands are primarily a statistical envelope.
MAD Volatility Trail converts its robust statistical envelope into a trend-regime system.
How this differs from median ± MAD alone
A simple median-MAD indicator would plot:
Median.
Median + MAD width.
Median - MAD width.
Those bands would move freely.
This indicator adds:
Ratchet logic.
Persistent bullish/bearish state.
Opposite-trail break conditions.
Optional median-slope confirmation.
Signals and alerts.
The raw statistical model is therefore only the first stage.
MAD versus ATR
ATR measures the size of trading ranges.
MAD measures dispersion of the selected source around its median.
They can behave very differently.
For example:
A volatile but mean-reverting market can have large ATR with relatively controlled median dispersion.
A persistent directional displacement can produce increasing MAD even if individual candle ranges are moderate.
The optional floor allows both concepts to coexist without replacing the MAD foundation.
Robust statistics and financial markets
Financial return and price distributions frequently contain:
Outliers.
Large jumps.
Skew.
Fat tails.
Mean-and-standard-deviation models remain extremely useful, but robust alternatives can provide different information when unusual observations are present.
Median and MAD belong to a family of robust statistical tools designed to reduce sensitivity to extreme sample values.
This does not make the resulting indicator immune to market shocks.
If enough of the rolling window moves, the median and MAD will also move.
The advantage is primarily that one isolated observation has less influence.
Strengths
Uses an exact rolling median.
Uses exact Median Absolute Deviation rather than an approximation.
More resistant to isolated outliers than mean/standard-deviation envelopes.
Provides a configurable MAD scale.
Supports a pure MAD or MAD-plus-ATR hybrid width.
Converts robust statistics into persistent trend boundaries.
Uses one-sided trail logic to reduce rapid regime switching.
Provides optional median-direction confirmation.
Separates signal logic from visual strength.
Includes dynamic gradient, glow and post-flip visualization.
Exposes raw MAD, scaled MAD, active band width and Trend Strength in the Data Window.
Limitations
The indicator is reactive rather than predictive.
Robust statistics do not eliminate whipsaws.
A very short MAD Lookback can still react sharply.
A very long lookback can delay adaptation to new regimes.
Median calculations can remain unchanged across several bars and then move discretely as the rolling sample changes.
Higher Deviation Factors reduce reversals but increase confirmation lag.
The ATR floor changes the model from pure MAD dispersion to a hybrid MAD/ATR structure.
Median Slope Confirmation can reject false breaks but also delay genuine reversals.
Extreme readings in the visual-strength system are not probabilities of continuation.
Glow and bloom are cosmetic and should not be treated as separate signals.
Computational considerations
Unlike many moving averages, the exact rolling median and MAD calculations require the script to build and process the values inside the selected window.
For each bar:
The rolling source sample is collected.
Its median is calculated.
Absolute deviations from that median are calculated.
A second median is calculated from those deviations.
Larger MAD Lookbacks therefore require more work than a simple recursive EMA or ATR calculation.
This is the cost of calculating the robust statistics directly.
Causality and live-bar behaviour
The indicator uses current and historical values without intentional future-looking references.
On completed historical bars, the model is causal.
On a live unfinished bar:
The Source can change.
The current rolling median can change.
MAD can change.
Raw bands can change.
A trail break can appear or disappear.
Users who require confirmed regime changes should evaluate signals at bar close.
Data Window
The indicator exposes four useful diagnostic values.
Raw MAD
The unscaled median absolute deviation.
Scaled MAD
Raw MAD multiplied by the selected MAD Scale.
Active Band Width
The actual band width after:
MAD scaling.
Deviation Factor.
Optional ATR minimum floor.
Trend Strength
The visual-strength score expressed from approximately 0 to 100.
This is calculated from trail distance and median movement.
It is not part of the trend-flip logic.
Alerts
The indicator includes:
MAD Trail Bullish: established bearish regime changes to bullish.
MAD Trail Bearish: established bullish regime changes to bearish.
MAD Trail Flip: either regime transition occurs.
Summary
MAD Volatility Trail builds a trend-following regime from robust statistics.
The calculation begins with an exact rolling median of the selected Source.
Rather than measuring dispersion with standard deviation, the script calculates the Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
The raw MAD is scaled and multiplied by a configurable Deviation Factor to create the statistical width around the rolling median.
The resulting raw upper and lower bands are:
Median + Band Width.
Median - Band Width.
An optional ATR minimum floor prevents these bands from becoming excessively narrow during low-dispersion conditions.
The raw envelope is then transformed into one-sided trailing boundaries.
The Lower Trail can ratchet upward while price remains above it, while the Upper Trail can ratchet downward while price remains below it.
These trails create hysteresis and form the actual regime-switching structure.
A bearish regime turns bullish only when the selected trigger breaks above the opposing Upper Trail, optionally while the rolling median itself is rising.
A bullish regime turns bearish only when the trigger breaks below the Lower Trail, optionally while the median is falling.
The active Lower Trail is displayed during bullish regimes and the active Upper Trail during bearish regimes.
A separate visual-strength model measures price-to-trail distance and median slope relative to the active band width. That score controls gradient and glow intensity but does not alter signals.
The result is a robust alternative to conventional mean-, standard-deviation- and ATR-centered trend trails.
Rather than allowing individual extreme prices to dominate its statistical center and dispersion estimate, MAD Volatility Trail uses the median twice: once to define the center of the distribution and again to define the typical absolute distance from that center.
This creates a trend framework designed around robust location, robust dispersion and persistent trailing structure .
Индикатор

Volatility Expansion Score (0-4) v2.2 [TotoMazter]Volatility Expansion Score (0-4)
WHAT IT IS
This indicator detects one specific market state: a compressed market whose calm is starting to break. It scores every closed bar from 0 to 4, one point per condition:
Compressed regime — ATR% in the lower tercile of its own last 500 bars
Expansion starting — ATR% higher than on the previous bar
Narrow Bollinger Bands — band width in the lower tercile of its last 120 bars
Volume waking up — tick volume above its 100-bar mean (z-score > 0)
Score 3 (orange) is the signal threshold; score 4 (red) is a full trigger. Everything is self-normalized (rolling percentiles and z-scores, no absolute levels), so the indicator needs no recalibration across price regimes: in our research it behaved the same with gold at 1,800 and at 4,800.
WHAT IT DOES NOT DO — READ THIS FIRST
It does NOT predict direction. In the research program behind this script, the directional question was tested three separate ways on 14 years of XAUUSD minute data — 132 technical variables, a dedicated 40-feature study (intraday synthetic dollar index, gold/silver lead-lag, compression context, M1 microstructure, path features), and real aggressor order flow from COMEX gold futures — and all three came back null. A 4/4 score says "an impulse is more likely than usual", never which way. Any use of this tool as a bullish/bearish signal is outside what was validated.
It also does not promise big moves in dollar terms. The signal fires when ATR is compressed (about 0.83x its normal level), and the subsequent move measured in % of price is slightly SMALLER than average (about 0.97x). What increases is the move relative to current volatility. If you size stops and targets in ATR units (R multiples), the historical edge is real; if you think in dollars, there is none.
MEASURED RESULTS (all historical, XAUUSD 1h, 2013-2026, ~79,000 bars)
Out-of-sample validation on a pre-registered 2023-2026 holdout, opened once: bars with score >= 3 were followed by a 2-ATR impulse 1.95x more often than the base rate (95% CI 1.76-2.03). Score = 4: 2.73x (CI 2.09-2.94).
Honest base rates: with a ~5% base impulse rate, 2.7x lift means roughly 13-14% of full triggers are followed by an impulse. Most signals are NOT followed by a large move. Position sizing must assume this.
The follow-through advantage, measured in ATR units and controlled for time of day, is about x1.106, favorable in all 21 measurable hourly buckets and in 13 of 14 years. Without the time-of-day control the raw number is x1.139 — the control matters, and the built-in table applies it for you.
Where signals cluster on gold: the New York morning (13:00-15:00 UTC) and the London open (08:00-09:00 UTC). The most volatile hour of gold's day in this dataset is 14:00 UTC (about 1.8x the daily average hourly range).
STOCKS (NVDA, AMD, TSLA — high-volume, high-volatility test set)
The signal transfers, but with roughly half the strength: x1.04-1.08 in ATR units after the same time-of-day control (below 1 in dollar terms). Three structural rules came out of that validation and are enforced by the script's guards:
Do not use 5-minute charts: intraday volume is U-shaped and the signal degenerates into a closing-auction detector (a fake x1.68 "edge" came entirely from the last 30 minutes of the session).
Do not use 1-hour charts on RTH equities: the session's partial bar has a smaller range by construction and concentrates signals. The script excludes partial bars automatically (marked with a dot).
Use 15m or 30m, and keep the characterization horizon inside the session (H <= 12 on 15m, H <= 11 on 30m). Windows containing long closures (overnight gaps, weekends) are excluded by the gap guard.
Earnings are not the driver: excluding extreme-gap days does not change the result.
THE BUILT-IN CHARACTERIZATION TABLE
The table answers, for THE SYMBOL AND TIMEFRAME ON YOUR CHART, whether the signal has historically preceded larger moves, using three measures: raw MFE in ATR (inflated by the denominator and by time of day — reference only), MFE in % of price (immune to the denominator), and the intra-hour advantage (computed within each hour of day, then aggregated — the one that decides, highlighted in yellow). It also reports the ATR-at-signal ratio (~0.8 expected) and the maximum hourly concentration of signals (if it exceeds ~8 pp, part of what you see is the clock, not the market). If it says "short sample", the guards are refusing to output a number that cannot be measured cleanly on your chart — that is a feature.
WHY IT IS ORIGINAL
Rolling percentiles converted to the exact convention of pandas rolling rank, so the script reproduces the research module it was ported from (practical parity check: on XAUUSD 1h, score >= 3 should fire on roughly 17% of bars, score = 4 on roughly 3.7%).
Wilder ATR (RMA), population standard deviations, closed-bar evaluation with alerts on bar close, and an entry reference at the next bar's open — no repainting of the validated signal.
Session guards: partial-bar exclusion (any intraday bar shorter than its timeframe) and a data-measured gap guard (characterization windows may not contain a closure longer than 3x the timeframe), so equity overnight gaps and weekends do not contaminate the statistics while gold's 1-hour daily break does not block them.
A self-auditing characterization table with denominator-aware and time-of-day-controlled measures. It will happily tell you the signal does NOT work on your chart.
SETTINGS
Signal windows (14 / 500 / 120 / 100) and tercile cuts are the canonical values of the validated module; changing them invalidates every reference number above. "Confirm on bar close" keeps the indicator inside its validated definition. The alert message includes the score breakdown and states that the entry reference is the next bar's open. The characterization table can be displayed in English or Spanish via the "Table language" setting.
LIMITATIONS
All figures are historical measurements from the research program described above; past behavior does not guarantee future behavior. The stock characterization is in-sample (no reserved validation window). This is a statistical tool for regime awareness — when to pay attention — not a trading system: it provides no direction, no entries, and no risk management. Индикатор

Macro HUDMacro HUD is an on-chart panel that shows the macro context around the instrument you are trading, so you can read price with the broader backdrop in view rather than in isolation.
Most indicators transform the price already on your chart into another form of the same price. Macro HUD does something different: it reads a set of other markets and presents their current state as context on a single panel, so you do not have to open several extra charts or an economic calendar to see the wider picture. It is a context dashboard, not a signal generator.
What it shows
The panel has four sections:
Macro engine — the US Dollar Index (DXY), the US 10-year and 2-year Treasury yields, crude oil, and the VIX. Each row shows its current value and a direction arrow measured over a lookback you set. The VIX row adds a volatility-regime band: Calm, Normal, Stressed, or Panic.
Regime — two plain-language reads derived from the rows above: a dollar read (bid or offered, from its recent direction) and a risk read (risk-on, risk-off, or mixed, from a chosen index's trend together with the VIX band).
Watchlist — up to five instruments of your choice, each labelled Bull or Bear depending on whether its price sits above or below a moving average, so you can see the directional state of a whole basket at a glance.
Event — an optional manual countdown to your next key economic releases. You enter the events yourself; the panel displays whichever is soonest and turns red inside a stand-down window you define.
How it works
Every value in the panel is requested from another symbol on a timeframe you choose (Daily by default) using request.security. The direction arrows compare the current value to the value a set number of bars earlier. The VIX band and the dollar and risk reads are simple threshold and trend rules applied to those requested values — the band uses fixed volatility thresholds, and the risk read combines an index's position relative to its moving average with the VIX band. The watchlist Bull/Bear flags compare each requested symbol's price to an EMA of its own price. The event countdown compares the current time to the timestamps you enter and shows the nearest upcoming one. Nothing in the panel is predictive; it reports the current state of external data.
Why it is original, and why these parts are combined
Macro HUD is not a single built-in republished, and it is not a mashup of overlapping signals. Each component answers a different question, and they are gathered together because a discretionary trader usually needs all of them at once before acting:
The macro engine answers "what is the broad backdrop?" — the dollar, rates, oil, and volatility.
The regime rows condense that backdrop into a plain read that can be absorbed at a glance.
The watchlist answers "what state is my basket in right now?" across several instruments without switching charts.
The event row answers "is it safe to act, or is a major release imminent?" — the one piece Pine cannot source on its own.
The purpose of the combination is to assemble, on one panel, the external context a trader would otherwise gather from several separate windows plus an economic calendar. No component duplicates another; each covers a distinct part of the question "should I be looking at this market now, and with what lean?" That specific, purpose-built combination is what the script contributes.
How to use it
Add it to any chart. Open the settings and point the macro and watchlist symbols at instruments your data plan supports, set the read timeframe (Daily gives the broad regime regardless of your chart timeframe), and choose the EMA length used for the Bull/Bear flags. If you follow economic events, type your next few releases into the event slots. The panel then updates live. Panel text colour is theme-aware by default and can be forced to black or white.
Limitations and things to be aware of
Pine cannot read the economic calendar or news, so the event slots are filled in by hand. If you do not maintain them, the event row simply shows that no event is set.
The direction arrows show short-term direction over your chosen lookback, not the absolute level. A market can show a down arrow while still being historically high, so read the arrow as recent drift, not position.
The regime reads are deliberately simple threshold and trend rules, not a proprietary model. They are a quick summary, not a forecast.
Some symbols (DXY, yields, VIX) depend on your TradingView data plan. If a row shows "n/a", open the settings and replace that symbol with one your plan provides. The script handles missing symbols without failing.
All values reflect the chosen read timeframe and update on that basis.
Scope
Macro HUD assembles context. It does not generate buy or sell signals, predict direction, or tell you what to do, and it makes no performance claims. The interpretation and every trading decision remain entirely yours.
This script is open-source. The full Pine code is available on this page for anyone to read, verify, and build upon.
Индикатор

Relative Volume (RVOL) PercentileRelative Volume (RVOL) Percentile
What it does
Relative Volume (RVOL) Percentile shows when participation on the current chart bar is unusual versus its own recent history. The pane displays a relative-volume histogram colored as Dry-up, Normal, High, or Extreme, with an optional norm line at 1.0x. It describes observed volume conditions only and does not generate directional trade signals.
How it works
The script compares each bar with a rolling sample of completed bars from the same chart timeframe. The current bar is excluded from both the baseline and percentile sample.
The baseline is either the median or simple moving average of the previous Lookback bars.
RVOL is current volume divided by that baseline. A value of 1.0 means current volume equals the selected norm.
Percentile rank is the percentage of the previous Lookback volume values that are less than or equal to current volume.
Dry-up is below the Dry-up threshold, Normal is below High, High is below Extreme, and Extreme is at or above the Extreme threshold.
How to use it
Add the script to a chart and choose a Lookback that represents the recent activity you want to compare.
Read bars near 1.0x as close to the selected volume norm, then use the stage color to judge how unusual that bar is within the recent sample.
Use High or Extreme transitions to identify unusually active bars and Dry-up transitions to identify unusually quiet bars.
Enable price-bar coloring or the last-bar RVOL label only when that extra context is useful.
Inputs
Lookback (Bars) - Number of prior completed chart bars used for both the baseline and percentile sample. Range 2-1000, default 20.
Baseline Method - Median reduces the influence of isolated spikes; SMA uses the arithmetic mean. Default Median.
Dry-up Below (%) - Percentile below which volume is classified as Dry-up. Range 0-100, default 15.
High From (%) - Percentile from which volume is classified as High. Range 0-100, default 80.
Extreme From (%) - Percentile from which volume is classified as Extreme. Range 0-100, default 95. Thresholds must remain in ascending order.
Show Histogram - Shows or hides the RVOL histogram. Default on.
Show Reference Line (Norm) - Shows or hides the 1.0x norm line. Default on.
Color Price Bars - Applies the same stage color to price bars on the main chart. Default off.
Show Value Label - Shows the current RVOL value on the last bar only. Default off.
Text Size - Numeric size for the optional last-bar label. Range 10-24, default 12.
Opacity (%) - Controls visual opacity. Range 0-100, default 70.
Dry-up / Normal / High / Extreme colors - Sets the four stage colors used by the histogram and optional price-bar coloring.
Signals and alerts
Relative Volume - Extreme - fires on a confirmed bar when the stage newly becomes Extreme.
Relative Volume - High - fires on a confirmed bar when the stage crosses from below High into High or Extreme.
Relative Volume - Dry-up - fires on a confirmed bar when the stage newly becomes Dry-up.
Repainting
The baseline and percentile sample use only prior chart bars. Alert transitions require the current chart bar to be confirmed, so an alert state is not finalized from an unfinished bar. The histogram can move with live volume while the current bar is open because it describes that still-forming bar; closed historical bars are not rewritten afterward.
Limitations
The script uses total chart-bar volume only. It does not estimate buy/sell delta, footprint data, or intrabar order flow.
Percentile rank is relative to the chosen Lookback, so different sample lengths can classify the same bar differently.
Markets or symbols with missing, sparse, or non-comparable volume data can produce incomplete or less useful readings.
The script measures volume anomaly only. It does not predict direction, continuation, reversal, or future price movement.
This script is a charting tool for educational purposes. It does not provide financial advice and does not predict future price movement. Trading carries risk; decisions and their outcome remain yours. Индикатор

Стратегия
