OPEN-SOURCE SCRIPT
Updated

Delivery Regime Map [AGPro Series]

816
Delivery Regime Map [AGPro Series]

🔹 Overview

Delivery Regime Map classifies the market's delivery character into four distinct regimes — Balanced, Directional, Fragmented, and Exhausted — giving traders instant context on whether the tape is trending with conviction, consolidating, breaking into volatile chop, or fading after an extended move. Rather than asking "is this bullish or bearish?", DRM answers a more useful question: "what kind of market am I in, and what kind of setup is appropriate here?"

The indicator overlays a soft state ribbon across the chart, prints confirmed regime shift labels at the moment of transition, and maintains a compact status panel with the active regime, a composite conviction score, regime duration, and time since the last shift. All outputs are confirmed on bar close with dwell-based hysteresis to suppress noise.


🎯 Unique Edge

Most regime or trend-strength tools collapse the market into a single linear axis (strong ↔ weak, bullish ↔ bearish). Delivery Regime Map is categorical, not linear — it identifies the qualitative character of price delivery by fusing four independent dimensions:

• Displacement quality (how much of each bar's range is body vs. wick)
• Directional persistence (close-to-close consistency + EMA slope alignment)
• Continuity (same-side runs penalized by gap noise)
• Range expansion (current range normalized by ATR baseline)

These dimensions combine into a composite score, but the regime classification uses banded thresholds with hysteresis — meaning a Directional tape must decisively lose its edge before flipping to Fragmented or Exhausted. This produces sparse, high-conviction transitions rather than the constant flipping typical of single-value strength meters.


⚙️ Methodology

The engine computes five rolling metrics across a user-defined window (default 20 bars):

1. Displacement Quality — |close − open| / range, smoothed. High values mean strong, decisive bars with minimal wick rejection.

2. Directional Persistence — average signed close direction plus an EMA slope-alignment check. Rewards tapes that move one way without reversing.

3. Continuity — the proportion of consecutive same-side candles, penalized by an average gap-size term (opens far from prior closes indicate fractured delivery).

4. Range Expansion — current range vs. ATR baseline, clipped to [0, 1]. High expansion combined with low continuity flags Fragmented tapes.

5. Exhaustion Proxy — the decay rate of displacement quality after a period of high persistence. Triggers near trend terminations where bars shrink while direction lingers.

A classifier selects the active regime by priority (Directional → Exhausted → Fragmented → Balanced), and a dwell-bar confirmation (default 5 bars, or 8 under Strict mode) plus a minimum-gap filter (default 10 bars) prevent whipsaw transitions.


🚦 Signals & Alerts

Four alert conditions are built in, each firing only on a confirmed regime shift:

• Regime shifted to Directional — conviction is rising; the tape is trending
• Regime shifted to Fragmented — wide, disconnected bars; chop risk elevated
• Regime shifted to Exhausted — prior trend is losing steam; mean-reversion risk
• Regime shifted to Balanced — low-conviction state; breakout potential building

All alerts include the ticker and interval in the message payload.


🎛️ Key Inputs

• Regime Window (8–60) — length of the measurement window
• Regime Sensitivity (Low / Normal / High) — hysteresis band width
• Strict Classifier — extends dwell requirement from 5 to 8 bars
• Minimum Bars Between Shifts — anti-chop spacing filter
• Show State Ribbon / Regime Shift Labels — visual toggles
• Panel Position + Font Size — 6 anchor positions, 5 size options
• Label Font Size — matches user's chart density preference

Every input carries an inline tooltip explaining its behavior and tradeoffs.


📚 How to Use

• Use Directional regimes to favor trend-following entries and trailing stops
• Use Balanced regimes to prepare for breakouts; volatility compression often precedes expansion
• Use Fragmented regimes as a caution flag — reduce size, widen stops, or stand aside
• Use Exhausted regimes to tighten trailing stops on open trend positions; the edge may be fading

DRM is designed to be asset-agnostic and timeframe-agnostic. On lower timeframes (1m–15m), consider Strict mode and a larger minimum-gap value. On daily charts, defaults typically work well. Combine with any entry framework — order blocks, breakout levels, VWAP reclaims — as a regime filter that answers "should I even be looking for a setup here?"


⚠️ Limitations & Transparency

• The classifier is reactive, not predictive — it confirms regime changes on close, so a Directional label appears a few bars after the trend has begun. This is by design: dwell confirmation is the primary noise filter.
• Regime definitions are categorical interpretations of price statistics. They are not forecasts.
• The composite score reflects regime conviction, not directional bias. A high score in Fragmented means "confidently choppy", not "confidently bullish".
• This indicator is not a strategy. It produces no entry signals, no take-profit targets, and no stop-loss levels. It is a market-context tool intended to be combined with a trader's existing framework.
• Past regime behavior does not guarantee future regime behavior. Market character can change abruptly on news or macro events.


📜 Risk Disclosure

This indicator is published for educational and analytical purposes only. It does not constitute financial advice, a trading recommendation, or an offer to buy or sell any instrument. Trading and investing carry risk of loss, and past performance does not guarantee future results. Users are solely responsible for their own decisions and should consult qualified professionals before committing capital.
Release Notes
🔧 UPDATE NOTES - V1.3

This update focuses on readability, structure, visual clarity, and usability.

The core purpose of the script remains unchanged.
This release improves how the existing delivery regime logic is presented, organized, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Rebuilt the source header and naming structure.
The public script title now follows the current AGPro Series format while the panel title keeps the AG Pro brand presentation.

• Added a price-mapped delivery ribbon.
The map now provides an on-chart regime layer instead of relying only on background tint and panel text.

• Refined regime state language.
Balanced, Directional, Fragmented, and Exhausted regimes now map into clearer operational states: WAIT, READY, BLOCKED, and MONITOR.

• Added live regime tagging.
A compact right-side tag now keeps the current delivery regime visible without requiring extra historical labels.

• Rebuilt the panel lifecycle.
The panel uses the required single merged blue header row and avoids clearing the header row during normal updates.


------------------------
Visual Improvements
------------------------

• Improved chart readability by adding the delivery ribbon, optional ribbon glow, and cleaner regime shift labels.

• Reduced visual clutter by making background tint optional and relying on the ribbon as the primary visual layer.

• Refined visual hierarchy so delivery score, duration, and current regime stand out more clearly.

• Adjusted label positioning to avoid overlap with candles and to keep the chart publication-friendly.


------------------------
Interface & Usability
------------------------

• Optimized panel layout for clearer information flow.

• Added configurable label density, label font size, panel font size, panel position, and panel theme controls.

• Kept the summary panel enabled by default for immediate context.

• Enhanced overall user experience without changing the core delivery regime logic.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical purpose of the script.

The goal is to improve clarity and usability, not to introduce predictive behavior.

Users should interpret outputs the same way as before, but with improved visual structure.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and confirmation delay may affect how regime shifts appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
UPDATE NOTES - V1.4

This update focuses on visual clarity, active-zone readability, panel standardization, and public-chart usability.

The core purpose of the script remains unchanged.
This release improves how the existing delivery-regime logic is presented, organized, and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

* Added an active delivery zone.
The refreshed chart now includes a focused rolling zone around the current delivery window, helping the regime map read more like a structured price area instead of only a ribbon.

* Added a centered zone badge.
The active zone now carries a contrast-safe centered badge with the current delivery regime and score context.

* Refined chart-facing label language.
Shift labels, live tags, score tags, and zone badges now use compact uppercase formatting for a cleaner publication look.

* Improved live right-edge context.
The refreshed version adds a live regime tag, score tag, and thin connector line back to the delivery ribbon.

* Standardized panel controls.
Panel Location, Panel Theme, Panel Font Size, and Show Panel controls now align with the newer AGPro public refresh baseline.


------------------------
Visual Improvements
------------------------

* Improved chart readability by keeping the delivery ribbon as the primary visual anchor.

* Added a focused active-zone layer without covering the full chart.

* Added a centered premium badge inside the active delivery zone.

* Increased default label offset so regime labels are less likely to sit inside candle bodies.

* Reduced default label memory slightly to keep the chart useful without becoming crowded.

* Improved right-edge context so the current regime and score can be read quickly.


------------------------
Interface & Usability
------------------------

* Kept Show Panel enabled by default.

* Renamed Panel Position to Panel Location.

* Preserved Panel Theme and Panel Font Size controls.

* Preserved Label Font Size control for chart labels, zone badges, and live tags.

* Preserved the single merged blue AG Pro panel header.

* Expanded the panel flow with State, Regime, Workflow, Delivery Score, Duration, Mode, and metric detail.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The displacement quality, persistence, continuity, expansion, fade pressure, and final delivery score model remain aligned with the previous version.

The goal is to improve clarity and usability, not to introduce new predictive behavior.

Users should interpret outputs the same way as before, but with improved visual structure and faster context recognition.


------------------------
Alerts Logic
------------------------

Alerts remain attention markers only.

They describe confirmed delivery-regime shifts and do not represent trade instructions, prediction, automation, or guaranteed outcomes.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, session structure, and timeframe differences may affect how regimes appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
🔧 UPDATE NOTES - V1.5

This update focuses on publication polish, active-zone readability, tag spacing, and panel placement flexibility.

The core purpose of the script remains unchanged.
Delivery Regime Map continues to classify market delivery into Balanced, Directional, Fragmented, and Exhausted regimes.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Refined active delivery zone badge placement
The active zone badge is now centered using the full active zone span instead of being placed toward the left side of the window.

• Shortened active zone badge text
The zone badge now uses a cleaner two-line format focused on regime and score for better first-glance readability.

• Added live tag offset control
A new Live Tag Offset Bars input allows the live regime and score tags to be moved farther right when needed.

• Expanded panel location options
Panel placement now includes Top Center, Middle Center, and Bottom Center options.

• Standardized panel refresh behavior
The panel refresh now clears and rebuilds the merged blue header row consistently during last-bar updates.


------------------------
Visual Improvements
------------------------

• Improved chart readability by centering the active delivery-zone badge more accurately.

• Reduced overlap risk between live right-side tags and active zone labels.

• Refined visual hierarchy so regime state, score, ribbon, zone, and live context tags feel cleaner together.

• Preserved the existing delivery ribbon, glow, shift labels, active delivery zone, and AG Pro panel structure.


------------------------
Interface & Usability
------------------------

• Added Live Tag Offset Bars for better chart-specific spacing control.

• Added center panel placements for more flexible publication screenshots.

• Preserved panel show/hide, theme, location, and font-size controls.

• Preserved label density, label font-size, and live-tag controls.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The goal is to improve clarity and usability, not to introduce new predictive behavior.

Users should interpret outputs the same way as before, but with cleaner visual spacing and stronger publication defaults.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and confirmation delay may affect how regime shifts appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
🔧 UPDATE NOTES - V1.6

This update focuses on readability, visual clarity, and chart structure.

The core purpose of the script remains unchanged.
This release improves how the existing delivery regime logic is presented and interpreted on the chart.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Repositioned the zone badge into the clear projection area
The regime badge now sits in the open projection area of the active delivery zone, vertically centered, so it stays readable without overlapping the candles.

• Consolidated the right-side tags into a single status card
The two separate right-edge tags are now combined into one clean status card showing the regime state, regime, delivery score, and the displacement / direction / continuity readings together.

• Status card kept clear of the active zone
The status card is automatically positioned to the right of the active delivery zone to avoid overlap, and stays connected to the ribbon.

• Added an inline delivery-score gauge
A compact 0-100 gauge now appears on the zone badge, the status card, and the panel score row for faster at-a-glance reading.


------------------------
Visual Improvements
------------------------

• Improved chart readability by keeping the zone badge out of the candles

• Reduced visual clutter on the right edge by replacing two staggered tags with one status card

• Refined visual hierarchy so regime, score, and metric readings stand out more clearly

• Adjusted positioning of the zone badge and status card to avoid overlap with candles and with each other


------------------------
Interface & Usability
------------------------

• Added a consistent inline delivery-score gauge for quicker interpretation

• Streamlined the right-edge context into a single, readable status card

• Adjusted default visual presentation for a more balanced appearance

• Enhanced overall readability without changing the core regime logic


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The goal is to improve clarity and usability, not to introduce new predictive behavior.

Users should interpret outputs the same way as before, but with improved visual structure.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how regimes and labels appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
UPDATE NOTES - V1.7

This update focuses on on-chart readability and a cleaner, more consistent premium presentation.

The core purpose of the script remains unchanged.
This release improves how the existing delivery-regime readout is displayed on the chart, the regime shift labels, the centered zone badge, the right-side status card, and the panel. It does not change the regime classifier, the delivery scoring, the confirmation logic, or the alerts.

This script continues to function as a chart-first delivery regime classification and visualization tool. It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

- Cleaner score readout
The small inline bar next to the delivery score has been removed from the panel, the zone badge, and the status card. The score now reads as a clean value (for example, "53 / 100"), which is easier to read at a glance.

- Consistent Title Case
All on-chart regime, state, and workflow text now uses Title Case (Directional, Fragmented, Exhausted, Balanced, Ready, Blocked, Monitor, Wait, Clean Delivery, Broken Flow) instead of all-caps. The zone badge and panel rows follow the same calmer style.

- Tidier zone badge and status card
The centered zone badge and the right-side status card were simplified so the regime, the score, and the metric readings stay clear and uncluttered.

- No logic changes
The delivery regime classifier, the displacement, persistence, continuity, and expansion metrics, the delivery score, the confirmation and shift logic, and all alerts behave exactly as before.


------------------------
Visual Improvements
------------------------

- Improved chart readability by simplifying the score readout and unifying label casing across shift labels, the zone badge, the status card, and the panel.

- Reduced visual noise so the active delivery regime stands out more clearly.

- Refined the visual hierarchy between the delivery ribbon, the active delivery zone, the centered badge, and the right-side status card.

- Kept the centered zone badge in the clear projection area and shift labels offset from candles to reduce overlap.


------------------------
Interface & Usability
------------------------

- Cleaner panel and badge value formatting for a more balanced, premium appearance.

- More consistent wording between the panel, the shift labels, the zone badge, and the status card.

- Default visual settings remain tuned for clean public-release screenshots.

- Overall user experience improved without changing core logic.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The goal is to improve clarity and presentation, not to introduce new predictive behavior.

Users should interpret outputs the same way as before, now with a cleaner and more consistent on-chart readout.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how delivery regimes appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
🔧 UPDATE NOTES - v1.8

This update focuses on decision confidence and proof.

The core purpose of the script remains unchanged.
This release adds a confirmation-anchored proof layer that measures how stable
past delivery-regime calls were on the current symbol.

This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.


------------------------
What Changed
------------------------

• Added a Proof Layer (Follow / Hold / React / Flip)
The panel now reports how stable past regime calls were on the current symbol and
timeframe. Each confirmed regime is tracked forward over a configurable horizon and
graded on whether it persisted intact or was replaced:
- React Rate : share of regimes that survived the early reaction window unchanged
- Follow Rate : share that survived to roughly half the horizon unchanged
- Hold Rate : share that persisted intact for the full horizon
- Flip Rate : share that was replaced by a different regime within the horizon
React, Follow, and Hold form a stability ladder (React covers the most, Hold the
strictest), and Hold and Flip are complementary.

• Added a sample-size readout
The panel shows n so the rates are read in context, and displays "building" until the
first regime window has resolved.

• Added hidden data exports
The delivery score, displacement, directional, and continuity metrics, plus the
Follow / Hold / React / Flip rates, are exposed as hidden plots so they can be referenced
by alerts, screeners, or other tools without changing the chart visuals.


------------------------
Visual Improvements
------------------------

• Grouped the proof metrics into a clean block under a dedicated "Proof @ Confirm" heading.

• Preserved the existing delivery ribbon, glow, active zone, centered zone badge,
shift labels, and right-edge status card.

• Refined panel structure so regime state, workflow read, score, and proof context
form a single, scannable decision card.

• Kept the active-zone badge vertically centered in the clear projection area and all
shift labels offset away from candles for clean readability.


------------------------
Interface & Usability
------------------------

• Optimized panel layout for clearer information flow with the new proof block.

• Improved at-a-glance interpretation by reporting how durable each regime call tends
to be on the current market.

• Adjusted default visual settings for a more balanced appearance.

• Added a Proof input group (show/hide, proof horizon bars, reaction window bars) so the
proof layer is fully configurable without affecting the core regime logic.


------------------------
Behavior Notes
------------------------

This update does not change the core analytical logic of the script.

The proof rates are descriptive statistics of past regime calls on the current symbol
and timeframe. They measure regime stability (how long a regime tends to persist before
being replaced), not trade performance, and they do not change how regimes are classified.

Users should interpret outputs the same way as before, now with added stability context.


------------------------
Limitations Reminder
------------------------

The script remains a rule-based analytical tool.

Proof rates depend on the amount of available history and on the current symbol and
timeframe; a small sample (low n) should be treated with caution. Each horizon window is
graded once. Market conditions such as volatility, liquidity, and timeframe differences
may affect how regimes and rates appear.

Outputs should always be interpreted within broader market context.


------------------------
Risk Reminder
------------------------

This script is for educational and analytical purposes only.

It does not provide financial advice or guaranteed trading outcomes.

Users remain responsible for their own decisions.
Release Notes
Version 1.9 — Regime Confirmation, Proof Integrity and Runtime Hardening

This update strengthens confirmed-regime transitions, proof-layer sampling, active-zone rendering, initialization safety, and runtime efficiency while preserving the indicator’s core delivery-classification model, visual identity, panel structure, input names, alerts, and publication workflow.

• Added confirmed-close promotion for new delivery regimes. Raw regime candidates must now complete their dwell requirement on a confirmed bar before the active regime can change.

• Improved consistency between historical regime shifts, live chart behavior, labels, and alerts by preventing unconfirmed intrabar regime promotion.

• Added minimum-tick protection to the ATR normalization layer, improving stability on flat, synthetic, low-volatility, and limited-price-resolution symbols.

• Rebuilt the confirmation-anchored proof model around one evaluation per confirmed regime call.

• Removed repeated proof re-sampling of the same unchanged regime after each completed horizon. This prevents long-lasting regimes from artificially inflating the proof sample size.

• The first valid post-warmup regime is now seeded once, while subsequent proof evaluations begin only after a confirmed regime shift.

• Refined Follow, Hold, React, and Flip statistics so each completed sample represents a distinct confirmed regime call rather than a rolling sequence of overlapping horizon windows.

• Constrained the effective Reaction Window to remain inside the Proof Horizon.

• Protected the intermediate Follow checkpoint so it cannot extend beyond the active proof horizon under custom settings.

• Preserved React when the new regime survives the early confirmation window.

• Preserved Follow when the regime remains intact through the intermediate proof checkpoint.

• Preserved Hold when the regime survives the full proof horizon without replacement.

• Preserved Flip when the confirmed regime is replaced before completing the horizon.

• Reworked the active delivery zone into a persistent chart object. The zone is now updated through box setters instead of being deleted and recreated on every latest-bar refresh.

• Reworked the centered zone badge into a persistent label that updates its position, text, color, and size without unnecessary object recreation.

• Added safe cleanup behavior when the delivery zone or centered badge is disabled.

• Reduced repeated real-time object allocation and garbage collection, improving runtime efficiency on actively updating charts.

• Reduced drawing-object limits to better match the script’s actual box, line, and label requirements.

• Added hidden exports for the confirmed regime ID and current regime duration to support external analysis, alerts, and audit workflows.

• Preserved all existing delivery metrics, classifier thresholds, sensitivity modes, strict-classifier behavior, ribbon visuals, shift labels, live status card, panel rows, proof-rate exports, and alert titles.

Existing TradingView alerts should be deleted and recreated after installing Version 1.9 so they use the updated script logic and settings.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.