OPEN-SOURCE SCRIPT
Updated

AG Pro ATR Compression Map [AGPro Series]

1 056
AG Pro ATR Compression Map [AGPro Series]

Overview / What it does

AG Pro ATR Compression Map is a chart-first compression analysis tool designed to evaluate how organized a low-volatility phase is and how structurally developed that contraction has become.

Instead of treating every quiet market phase as equally meaningful, the script separates loose and unstable contraction from cleaner, more contained compression conditions. The goal is not to label every narrow range as important, but to provide a structured visual framework for monitoring whether a tightening phase is becoming more coherent and potentially worth closer attention.

The script is built for users who want to read compression quality directly on the chart without relying on overly complex dashboard-style presentation. It highlights active compression zones, assigns a normalized compression score, classifies the current state of contraction, and summarizes the condition through a compact on-chart panel.

This is intended as a context and monitoring tool. It does not attempt to forecast direction, guarantee expansion, or replace execution planning and risk management.

Unique Edge

The main idea behind this script is that low volatility alone is not enough.

Many consolidations look similar at first glance, but their internal structure can be very different. Some are noisy, unstable, and disorderly. Others become progressively tighter, cleaner, and more contained. AG Pro ATR Compression Map is designed to make that distinction clearer.

Its edge is not based on directional prediction. Instead, it evaluates compression quality through a blended framework that combines volatility contraction, local range tightening, internal noise behavior, and containment structure. This allows the script to differentiate between random quiet price action and more organized compression phases.

This also keeps the script distinct from tools that focus on breakout confirmation, retest quality, trend classification, or level-based pressure analysis. Here, the focus is narrower and more specific: measuring the quality of compression itself.

Methodology

The script combines four internal components into a unified compression score:

1) ATR contraction
Measures whether current ATR is compressed relative to its own baseline.

2) Range tightness
Measures whether the recent price range has narrowed compared with a broader reference window.

3) Noise evaluation
Evaluates whether the contraction phase is relatively clean or increasingly disordered. This includes internal bar behavior such as wick activity, directional flipping, and local overlap behavior.

4) Structural containment
Measures whether price is remaining contained within a tighter local area instead of drifting loosely inside a broad consolidation.

These components are normalized and combined into a 0-100 compression score.

The script then classifies the result into four stages:

• Loose
• Building
• Tight
• Mature

This stage logic is designed to help distinguish early contraction from more developed compression conditions. Higher states reflect more structured tightening, but not certainty of resolution.

What the script highlights

• Compression zone
A shaded chart area is displayed when compression conditions are active.

• Compression score
A compact label shows the current normalized compression score.

• State label
The current compression stage is shown directly on the chart.

• Mini panel
A small panel summarizes ATR state, range state, noise condition, containment quality, overall compression score, active state, and current compression window length.

Signals & Alerts

This script includes deterministic alert conditions for:

• Compression Active
Triggered when compression conditions become active according to the script's scoring logic.

• Compression Mature
Triggered when the current state reaches Mature.

• Compression State Change
Triggered when the internal compression state changes.

These alerts are designed to reflect state transitions inside the script's existing framework. They should be interpreted as analytical status changes, not as trade instructions.

Key Inputs

Main controls include:

• ATR Length
• Baseline Length
• Range Window
• Noise Window
• Containment Window
• Compression Threshold
• Mature Threshold

The script also includes display controls for zone visibility, labels, panel position, theme mode, text sizing, and label offset. Advanced options allow stricter filtering and additional sensitivity controls for wick behavior and close-overlap behavior.

How to read it

In practice, the script is most useful when users want to answer questions such as:

• Is this contraction still loose, or is it becoming more organized?
• Is the range tightening in a meaningful way, or is price simply drifting?
• Is the structure relatively clean, or is internal noise increasing?
• Has the compression developed enough to justify closer monitoring?

A higher compression score means the script is detecting tighter and more structured contraction conditions. A lower score suggests that the current quiet phase is still broad, unstable, or underdeveloped.

Best use cases

This script can be useful when monitoring:

• developing consolidations
• low-volatility phases inside broader trends
• pre-expansion observation zones
• structured pauses after directional movement
• markets where users want to distinguish clean compression from random inactivity

It is especially suited for traders who prefer chart-first context tools rather than signal-heavy overlays.

Limitations & Transparency

Compression can remain inactive for long periods, fail to resolve cleanly, or resolve without meaningful follow-through.

A high compression reading does not imply directional certainty, timing certainty, or inevitable expansion. Likewise, a low reading does not mean price cannot move sharply. The script measures structure quality inside contraction conditions. It does not measure certainty.

The output should be used as contextual information alongside price action, market structure, execution rules, and risk management.

What it does not do

This script does not:

• predict breakout direction
• guarantee expansion
• project targets
• replace trade planning
• function as a standalone entry engine

Risk Disclosure

For educational and analytical use only.
Release Notes
UPDATE NOTES - V1.1

This update focuses on chart presentation, readability, and visual hierarchy.

The core compression framework remains the same: the script still evaluates ATR contraction, range tightness, internal noise, and containment structure inside the existing compression scoring model. There is no intended change to the underlying methodology or to the documented alert semantics. The purpose of this release is to make the output easier to read and more effective as a chart-context tool.

snapshot

What changed

1) Compression zone presentation was refined.
- The active compression area now uses a more layered structure for better depth and visual separation.
- The zone keeps a clearer outer boundary while the internal banding is easier to follow during active tightening phases.
- The optional midline remains available for users who prefer extra internal structure.

2) Label behavior was improved.
- Active labels are now tied more directly to the active compression area instead of feeling detached from the zone.
- Compression and State labels are easier to interpret at a glance.
- When compression is not currently active, optional preview labels can still remain visible in a softer style so the chart does not become visually empty.
- Preview labels are informational only and should not be read as confirmation of an active compression state by themselves.

3) Panel presentation was upgraded.
- The mini panel now has a stronger visual hierarchy and cleaner row separation.
- A Score Meter was added to give a faster visual read of the current compression score.
- Tight, Building, Mature, and Loose states are easier to distinguish in both light and dark themes.
- Overall panel contrast and readability were improved.

4) Visual defaults were cleaned up.
- Label and panel text defaults were standardized for better out-of-the-box readability.
- Label offset behavior was tuned so labels sit more comfortably to the right side of the chart.
- Historical start/end dots are now disabled by default for a cleaner baseline view.
- Background glow was softened so it supports the chart instead of dominating it.

5) General chart polish.
- Guide lines connecting labels to the active zone were refined and made more subtle.
- Zone layering, fills, and outlines were adjusted for a cleaner premium look.
- The script now preserves more visual context without overwhelming the price chart.

snapshot

Practical note

This update is intended to improve how compression conditions are monitored and interpreted on-chart. It does not forecast breakout direction, guarantee continuation, or replace execution and risk management decisions. As before, the script should be used as a structured monitoring aid and not as a standalone decision engine.

In summary

V1.1 is primarily a presentation and usability update. The scoring logic stays familiar, while the chart output is cleaner, more informative, and better balanced across different timeframes and themes.
Release Notes
UPDATE NOTES - V1.2

This update focuses on presentation quality, visual clarity, and chart readability while preserving the script’s documented compression framework and state logic.

The main visual structure has been rebuilt around a smoother ribbon-style compression architecture so the chart reads as one continuous analytical object rather than a sequence of fragmented zone blocks. The goal of this update is to improve interpretability on live charts without reframing the tool as a prediction engine or changing its purpose.

What changed in this update:

1) Ribbon presentation was refined.
The previous visual structure could appear too segmented in some market phases. The updated version uses a more continuous ribbon-style presentation so compression behavior is easier to follow across changing volatility conditions.

2) Chart readability was improved.
Line thickness was reduced and the visual balance between the outer aura, main ribbon, and inner structure was refined. This helps the active structure remain visible without making the chart feel heavy.

3) State-based color separation was improved.
Loose, Building, Tight, and Mature conditions now read more clearly from the ribbon presentation, but the palette remains controlled to avoid unnecessary visual noise.

4) The visual hierarchy was cleaned up.
The active ribbon, right-edge information badges, and mini panel were tuned to work together more consistently. The result is a cleaner first-glance read, especially when compression is actively building or already tight.

5) The settings experience was improved.
Tooltips and input descriptions were expanded so users can understand the main ribbon and threshold controls more quickly inside the settings panel.

6) The update remains functionally aligned with the existing framework.
This release is primarily a presentation and usability update. It is not intended to redefine the script’s analytical purpose. The compression score, state engine, and alert structure remain aligned with the script’s established methodology.

Notes on scope:
- This update is designed to improve visual clarity and workflow efficiency.
- It does not claim to forecast breakouts or direction.
- It does not replace confirmation, execution planning, or risk management.
- It remains a state-mapping tool for volatility compression conditions.
Release Notes
AG Pro ATR Compression Map [AGPro Series]
Update Notes V1.5

This update focuses on visual structure, panel readability, and clearer compression-state presentation without changing the script’s core purpose.

What changed
- Refined the ribbon presentation for a cleaner and more structured overlay.
- Added a more visible active compression box to improve chart anchoring during compression phases.
- Improved the visual handling of resolved compression areas so the active structure remains easier to read.
- Added and refined the internal guide structure of the compression box for better visual balance.
- Reduced unnecessary background emphasis to keep the chart cleaner.
- Updated the compact panel layout with the standardized single merged title row.
- Set the panel’s default text size to Small and kept label sizing aligned with the current visual standard.
- Improved dark-theme readability with stronger text contrast.
- Increased the visual separation between Dark and Light panel themes so each mode has a more distinct appearance.
- Set the default panel theme to Dark for a more consistent presentation.

Notes
- This update is mainly a presentation and usability refinement.
- The script remains an analysis and visualization tool. It does not predict direction and does not provide trade execution logic.
- As with any volatility-compression framework, signals and states should be interpreted in context with market structure, liquidity, and confirmation.

Risk Disclosure
This script is for chart analysis and educational use only. It is not financial advice.
Release Notes
UPDATE NOTES - V1.6

This update focuses on visual clarity, chart structure, and day-to-day usability while preserving the script’s core compression-mapping logic.

What changed:
- Refined the overall ribbon presentation for a cleaner and more premium visual profile.
- Improved the active compression structure so compressed zones are easier to read on the chart.
- Added longer box-based compression framing where conditions support it, helping the map feel more complete without overcrowding price action.
- Reworked the right-edge labels so they sit more clearly away from candles and remain easier to read in live chart conditions.
- Updated the compact panel styling with the standardized AGPro header layout and cleaner row hierarchy.
- Added more flexible display control with adjustable panel position, theme selection, and configurable text sizing for both panel and labels.
- Improved spacing and visual balance so the chart does not feel empty, while still keeping label density under control.
- Cleaned and streamlined the codebase for a more professional and efficient structure.

What stayed the same:
- The script remains focused on identifying and visualizing ATR-based compression conditions.
- This update does not turn the tool into a breakout predictor or trade automation system.
- The main purpose is still structural compression analysis, context reading, and alert support.

This is a refinement update designed to improve readability, presentation quality, and chart usability.
Release Notes
v1.7 - Premium Structure Update

Visual and usability refinement update.
- Removed the AG Pro prefix from the indicator title and short title while preserving AG Pro branding inside the panel header.
- Added a controlled Developing Box mode so qualified early compression structures can appear before the full compression gate is reached.
- Added Active Zone Projection for a cleaner forward structure view.
- Added ATR-based label padding to keep right-edge badges away from candles and zone boundaries.
- Added minimum archived-zone length filtering to reduce low-value historical clutter.
- Cleaned unused helper logic and tightened the visual palette around the AGPro Series color system.

No changes to alert names or the core compression scoring model.
Release Notes
🔧 UPDATE NOTES - V1.8

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

The core purpose of the script remains unchanged.
This release improves how ATR compression, range contraction, containment quality, and expansion readiness are presented 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 visual structure around a cleaner compression pocket.
The active compression area now appears as a premium chart zone with centered pocket text, projected structure, and clearer boundaries.

• Added a stronger decision-style panel.
The panel now emphasizes Compression Score, State, Structure, Pressure, and Action instead of only showing raw component metrics.

• Improved the state engine presentation.
Compression phases are easier to read as Loose, Building, Tight, and Mature, with action states such as COMPRESSION READY, MATURE WATCH, RELEASE WATCH, and RELEASE events.

• Added right-side context tags.
The chart now displays compact right-edge tags for score, upper rail, lower rail, and action context so the current structure can be understood quickly.

• Refined event labels.
Event labels are now selective, cleaner, and controlled by density settings to reduce clutter while keeping the chart visually active.


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

• Improved chart readability by adjusting compression pocket boundaries, centered zone text, right-side tags, and event label spacing.

• Reduced visual clutter by using selective labels and archived pocket memory instead of excessive repeated markers.

• Refined visual hierarchy so the active compression pocket, score tag, action tag, and panel stand out more clearly.

• Adjusted positioning of elements to keep labels away from candles and maintain a more professional screenshot layout.


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

• Optimized panel layout for clearer information flow.

• Added configurable panel visibility, panel location, panel theme, panel font size, and label font size.

• Changed label text size default to Normal for better publishing consistency.

• Improved overall user experience without changing the script into an automated signal system.


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

This update keeps the core analytical purpose of the script intact.

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

Users should interpret outputs as volatility-compression context:
compression quality, pocket maturity, containment pressure, and possible release attention.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and sudden news-driven moves may affect how compression pockets 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.9

This update focuses on visual readability, panel structure, zone clarity, and first-glance interpretation.

The core purpose of the script remains unchanged.
This release improves how the existing ATR compression 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 compression pocket visual layer.
Active pockets now keep the main zone box clean while using a dedicated centered badge for the current compression state and score.

* Added stronger in-zone badge readability.
Pocket badges now use compact state language such as BUILD, TIGHT, and MATURE with the current score, rendered as a solid chart label inside the pocket.

* Improved archived pocket memory.
Completed qualified pockets now keep a faded memory box with a separate contrast-safe MEMORY score badge instead of weak native box text.

* Refined right-side context tags.
The right edge now highlights ATR score, rail context, noise / containment quality, and the current workflow state in a more compact format.

* Reworked event label language.
Labels now emphasize BUILD, READY, MATURE, NOISY, and REVIEW states without implying prediction or trade direction.

* Expanded panel controls.
The panel now supports show / hide, full location selection, dark / light theme, and font-size control.

* Rebuilt the panel flow.
The panel now prioritizes Workflow, Volatility, ATR / Range, Noise, Containment, Pocket, and Review status.

* Preserved controlled default density.
The default view keeps enough compression pockets, labels, right tags, and ribbon context for a fuller publication screenshot without excessive clutter.


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

* Improved chart readability by moving pocket text out of native box text and into a dedicated contrast-safe centered badge.

* Reduced weak or low-contrast zone text on light and dark charts.

* Refined visual hierarchy so the pocket, ribbon, rails, right-side tags, and event labels are easier to scan.

* Added clearer separation between active pocket context and archived pocket memory.

* Kept labels away from candle bodies with a stronger ATR-based offset.

* Preserved the compression ribbon while keeping price action visually dominant.


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

* Added complete panel location options, including top, middle, and bottom placements.

* Improved panel lifecycle handling when visibility, location, theme, or font size changes.

* Preserved label-size control for event labels, zone badges, and right-side tags.

* Improved the panel header to remain a single merged blue row with only the script name.

* Enhanced overall user experience without changing the underlying analytical logic.


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

This update does not change the core ATR compression scoring logic.

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, state language, and chart readability.


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

The script remains a rule-based analytical tool.

Market conditions such as liquidity, volatility regime, timeframe differences, and sudden news-driven movement may affect how compression pockets and release reviews 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 - v2.0

This update focuses on label presentation and readability.

The core purpose of the script remains unchanged. This release improves how the
existing compression pockets, state labels, right-side tags, and panel read on
the chart, with a cleaner and more consistent label style.

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
------------------------

- Title Case labels throughout
Pocket badges, event labels, archived-pocket badges, right-side tags, and the
panel workflow now use clean Title Case styling (Mature Compression, Ready ATR
Contracted, Track Compression, Memory) for a more premium and consistent look.

- Pocket and memory badges moved off the candles
The active pocket badge and archived-pocket badges now sit at the right edge of
their zone, instead of floating in the middle where they could overlap candles
and become hard to read.

- Theme-aware text everywhere
Pocket badges, event labels, right-side tags, and colored panel values now
choose a text color that reads clearly on both light and dark backgrounds,
using a brightness-accurate method so blue, green, amber, and pink fills all
stay readable.


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

- Consistent Title Case styling for all on-chart labels.

- Pocket and memory badges sit at the right edge of their zones, away from the
candles.

- Contrast-safe pocket, event, tag, and panel text on both themes.

- Preserved the familiar compression pocket, ribbon, midline, and quarter-guide
layout.


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

- Cleaner, more readable pocket and event labeling.

- Improved panel contrast across all rows on both themes.

- Adjusted default visual presentation for a more balanced, premium appearance.

- Enhanced overall user experience without changing core logic.


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

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

The ATR contraction reading, the range, noise, and containment scoring, the
state engine across Building, Tight, and Mature, the pocket lifecycle, the
release detection, and the panel statistics all behave exactly as before.

Users should interpret outputs the same way as before, but with cleaner labels
and a more readable presentation.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may
affect how compression pockets and states 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 - Version 2.1

This update focuses on adding a confirmation-anchored proof layer to the panel.

The core purpose of the script remains unchanged.
This release adds a proof layer that measures how often pocket releases expanded in the release
direction, and removes the redundant review row.

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 compression-pocket releases resolved on the current symbol and
timeframe. Each time price closes outside an active pocket, the release is tracked forward over a
configurable horizon using a symmetric risk unit measured in ATR (the favorable expansion target
and the adverse reference are placed the same distance from the release close, in the release
direction):
- Follow Rate : share of releases that expanded one risk unit in the release direction first
- Hold Rate : share whose adverse reference was not reached through resolution
- React Rate : share that produced an early favorable expansion reaction
- Flip Rate : share whose adverse reference was reached, meaning the release reversed
A sample size (n) is shown so the rates are read in context, and they display as "building" only
until the first release resolves.

* Removed the redundant review row
The review row repeated the pocket and volatility context already shown in their own rows. It was
replaced so the panel now carries the proof layer, keeping the workflow, volatility, ATR/range,
noise, containment, and pocket rows.

* Added hidden proof outputs
The compression score and the Follow, Hold, React, and Flip rates are exported as hidden plots so
they can be used in alerts and screeners without adding chart clutter.


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

* Reduced panel redundancy by removing the review row.

* Preserved the compression pockets, midline and quarter guides, archived pocket memory, the
compression ribbon, event labels, and the right-side tags.

* Kept label and pocket density controlled with the existing spacing and retention limits.


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

This update does not change the core compression, scoring, pocket, or release logic.

The proof rates are descriptive statistics of pocket releases on the current symbol and timeframe.
They measure how often a release expanded in its direction before reversing, and they do not
change how compression, scores, states, pockets, or releases are produced. Because the risk unit
is volatility-normalized, it adapts to the compressed ATR at the time of each release.

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


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

The script remains a rule-based analytical tool.

Proof rates depend on the available history and on how many releases occurred on the current
symbol and timeframe; a small sample (low n) should be treated with caution. Each release is
counted once, with the entry, target, and adverse reference frozen at the release bar. Market
conditions such as volatility, liquidity, and timeframe differences may affect how releases 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.

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.