OPEN-SOURCE SCRIPT
Обновлено AG Pro EMA Ribbon Compression Map [AGPro Series]

AG Pro EMA Ribbon Compression Map [AGPro Series]
Overview / What it does
AG Pro EMA Ribbon Compression Map is a ribbon-structure indicator built to read the internal condition of a multi-EMA cluster rather than the behavior of price around a single moving average. Instead of asking whether price reclaimed one reference EMA, this script evaluates how tightly the ribbon is compressed, how cleanly the EMAs are aligned, whether width is beginning to expand, and whether a developing move still looks organized or is starting to cool.
The default ribbon uses six EMAs and transforms their relative spacing into a visual structure that can be monitored directly on the chart. When the ribbon contracts, the script highlights coil conditions. When alignment and width expansion start to work together, it can mark bullish or bearish release conditions. When the ribbon is already wide and the expansion begins to lose energy, the script can flag fan-stretch / exhaustion behavior.
This makes the tool suitable for traders who want to study transition phases between compression, release, expansion, and late-stage cooling without reducing the chart to a single crossover event. It is designed as a structural read of ribbon behavior.
Unique Edge
The main objective of this script is not to provide another generic EMA ribbon display. Its edge comes from turning ribbon behavior into a state map.
First, it measures compression through normalized ribbon width rather than relying only on visual judgment. This helps distinguish between a ribbon that merely looks narrow and a ribbon that is statistically tight relative to its own recent behavior.
Second, it combines two layers of organization into one alignment read:
1) order agreement between the EMAs
2) slope agreement across the ribbon
This is important because a ribbon can appear stacked correctly while already losing directional integrity. By combining order and slope, the script attempts to separate cleaner directional structure from weaker, mixed, or transitional structure.
Third, the script focuses on release quality as a context event. A release is not treated as a simple EMA cross. It requires compression context, directional alignment, price location relative to the ribbon, and width expansion behavior. In practice, this helps frame release events as structural transitions rather than isolated triggers.
This also differentiates the script from single-EMA reclaim tools. AG Pro EMA Ribbon Compression Map is not built to analyze reactions around one anchor average. Its purpose is to interpret the internal geometry of the ribbon itself.
Methodology
The default ribbon is built from six EMAs:
8, 13, 21, 34, 55, and 89.
The script calculates the highest and lowest EMA in the group, derives ribbon width, and normalizes that width using ATR. It then compares the normalized width to its own historical range over the selected compression lookback. From this process, a Compression Score and an Expansion Score are derived.
Alignment is built from two components:
- EMA order agreement
- EMA slope agreement
If the ribbon is fully stacked in one direction and most slopes support that direction, alignment improves. If order and slope start to disagree, alignment weakens and the state can shift toward mixed / disorder behavior.
The state logic is designed around the following structural phases:
- Bullish Coil
- Bearish Coil
- Tight Compression
- Bullish Release
- Bearish Release
- Bullish Expansion
- Bearish Expansion
- Mixed / Disorder
- Fan Stretch / Exhaustion
- Transition
The visual model is intended to keep the chart readable while still making the ribbon feel alive. Compression and release are not presented as forecasting claims. They are chart states derived from ribbon width, order, slope, and price position relative to the ribbon.
Signals & Alerts
This script can display event labels for key structural transitions and can generate alerts for the most important state changes.
Available alert conditions include:
- Bullish Ribbon Release
- Bearish Ribbon Release
- Ribbon Compression Start
- Ribbon Compression Exit
- Ribbon Exhaustion
In practical use, traders may choose to treat these alerts as workflow signals rather than standalone decisions. For example, a compression start can identify a tightening structure worth monitoring. A bullish or bearish release can indicate that the ribbon is transitioning out of compression with directional alignment. An exhaustion event can indicate that a previously expanding ribbon may no longer be accelerating.
The script also includes an on-chart panel that summarizes:
- current state
- compression score
- alignment score
- directional bias
- width condition
Key Inputs
Ribbon Settings
- Six EMA lengths
- price source
Compression Engine
- ATR length
- compression lookback
- compression threshold
- minimum width expansion
- slope lookback
- exhaustion threshold
Visual Settings
- ribbon fill visibility
- event label visibility
- panel visibility
- optional bar tinting
- label size
- panel position
- label density and cooldown controls
These settings allow the script to be adapted to different instruments and timeframes. Users can keep the default ribbon structure or study how different EMA sets behave across their own workflow.
Limitations & Transparency
This script is not a prediction engine. It does not know whether a compression will resolve into continuation, reversal, or failed expansion. It reads ribbon structure; it does not guarantee outcome.
Compression is a contextual condition, not a trade confirmation by itself. A tightly compressed ribbon can remain compressed longer than expected. Likewise, a release event can still fail if the move does not continue.
Alignment is based on moving averages and slope behavior, which means the script is responsive to structure but still derived from lagging calculations. That tradeoff is intentional: the goal is to improve structural clarity, not to eliminate lag altogether.
The indicator is also not a substitute for market context, support / resistance work, volatility analysis, or risk management. It is best used as a chart-structure tool inside a broader decision process.
Risk Disclosure
This indicator is for chart analysis and workflow support only. It does not provide financial advice, investment advice, or guaranteed trade outcomes. All trading decisions involve risk, and users should evaluate any signal, state change, or alert within their own methodology, market conditions, and risk framework.
Overview / What it does
AG Pro EMA Ribbon Compression Map is a ribbon-structure indicator built to read the internal condition of a multi-EMA cluster rather than the behavior of price around a single moving average. Instead of asking whether price reclaimed one reference EMA, this script evaluates how tightly the ribbon is compressed, how cleanly the EMAs are aligned, whether width is beginning to expand, and whether a developing move still looks organized or is starting to cool.
The default ribbon uses six EMAs and transforms their relative spacing into a visual structure that can be monitored directly on the chart. When the ribbon contracts, the script highlights coil conditions. When alignment and width expansion start to work together, it can mark bullish or bearish release conditions. When the ribbon is already wide and the expansion begins to lose energy, the script can flag fan-stretch / exhaustion behavior.
This makes the tool suitable for traders who want to study transition phases between compression, release, expansion, and late-stage cooling without reducing the chart to a single crossover event. It is designed as a structural read of ribbon behavior.
Unique Edge
The main objective of this script is not to provide another generic EMA ribbon display. Its edge comes from turning ribbon behavior into a state map.
First, it measures compression through normalized ribbon width rather than relying only on visual judgment. This helps distinguish between a ribbon that merely looks narrow and a ribbon that is statistically tight relative to its own recent behavior.
Second, it combines two layers of organization into one alignment read:
1) order agreement between the EMAs
2) slope agreement across the ribbon
This is important because a ribbon can appear stacked correctly while already losing directional integrity. By combining order and slope, the script attempts to separate cleaner directional structure from weaker, mixed, or transitional structure.
Third, the script focuses on release quality as a context event. A release is not treated as a simple EMA cross. It requires compression context, directional alignment, price location relative to the ribbon, and width expansion behavior. In practice, this helps frame release events as structural transitions rather than isolated triggers.
This also differentiates the script from single-EMA reclaim tools. AG Pro EMA Ribbon Compression Map is not built to analyze reactions around one anchor average. Its purpose is to interpret the internal geometry of the ribbon itself.
Methodology
The default ribbon is built from six EMAs:
8, 13, 21, 34, 55, and 89.
The script calculates the highest and lowest EMA in the group, derives ribbon width, and normalizes that width using ATR. It then compares the normalized width to its own historical range over the selected compression lookback. From this process, a Compression Score and an Expansion Score are derived.
Alignment is built from two components:
- EMA order agreement
- EMA slope agreement
If the ribbon is fully stacked in one direction and most slopes support that direction, alignment improves. If order and slope start to disagree, alignment weakens and the state can shift toward mixed / disorder behavior.
The state logic is designed around the following structural phases:
- Bullish Coil
- Bearish Coil
- Tight Compression
- Bullish Release
- Bearish Release
- Bullish Expansion
- Bearish Expansion
- Mixed / Disorder
- Fan Stretch / Exhaustion
- Transition
The visual model is intended to keep the chart readable while still making the ribbon feel alive. Compression and release are not presented as forecasting claims. They are chart states derived from ribbon width, order, slope, and price position relative to the ribbon.
Signals & Alerts
This script can display event labels for key structural transitions and can generate alerts for the most important state changes.
Available alert conditions include:
- Bullish Ribbon Release
- Bearish Ribbon Release
- Ribbon Compression Start
- Ribbon Compression Exit
- Ribbon Exhaustion
In practical use, traders may choose to treat these alerts as workflow signals rather than standalone decisions. For example, a compression start can identify a tightening structure worth monitoring. A bullish or bearish release can indicate that the ribbon is transitioning out of compression with directional alignment. An exhaustion event can indicate that a previously expanding ribbon may no longer be accelerating.
The script also includes an on-chart panel that summarizes:
- current state
- compression score
- alignment score
- directional bias
- width condition
Key Inputs
Ribbon Settings
- Six EMA lengths
- price source
Compression Engine
- ATR length
- compression lookback
- compression threshold
- minimum width expansion
- slope lookback
- exhaustion threshold
Visual Settings
- ribbon fill visibility
- event label visibility
- panel visibility
- optional bar tinting
- label size
- panel position
- label density and cooldown controls
These settings allow the script to be adapted to different instruments and timeframes. Users can keep the default ribbon structure or study how different EMA sets behave across their own workflow.
Limitations & Transparency
This script is not a prediction engine. It does not know whether a compression will resolve into continuation, reversal, or failed expansion. It reads ribbon structure; it does not guarantee outcome.
Compression is a contextual condition, not a trade confirmation by itself. A tightly compressed ribbon can remain compressed longer than expected. Likewise, a release event can still fail if the move does not continue.
Alignment is based on moving averages and slope behavior, which means the script is responsive to structure but still derived from lagging calculations. That tradeoff is intentional: the goal is to improve structural clarity, not to eliminate lag altogether.
The indicator is also not a substitute for market context, support / resistance work, volatility analysis, or risk management. It is best used as a chart-structure tool inside a broader decision process.
Risk Disclosure
This indicator is for chart analysis and workflow support only. It does not provide financial advice, investment advice, or guaranteed trade outcomes. All trading decisions involve risk, and users should evaluate any signal, state change, or alert within their own methodology, market conditions, and risk framework.
Информация о релизе
Update Notes - V2.4This update focuses on visual refinement, readability, and chart balance.
What changed:
- Refined the ribbon presentation to reduce visual dominance over price candles.
- Softened zone fills for a cleaner chart appearance.
- Reduced the visual weight of ribbon boundary lines.
- Improved overall line delicacy for a more balanced overlay.
- Updated the panel styling to match the current AG Pro panel format.
- Kept the top panel row as a single merged blue header with the script name only.
- Improved panel text contrast for better readability in dark theme usage.
- Preserved a small default panel font and normal default label size.
- Maintained the existing event labeling structure while keeping the chart easier to read.
Notes:
- This update is primarily visual and presentation-oriented.
- Core logic and signal structure remain aligned with the original concept of ribbon compression, release, and expansion state tracking.
- The script is designed for chart analysis and alert workflow support. It does not provide financial advice and does not guarantee outcomes.
Информация о релизе
Version 3.0 Update NotesThis update is a full structural refinement designed to make the script more distinctive, more chart-readable, and more useful as a premium ribbon workflow tool.
What is new
1. Added ribbon-derived Launch Zones
The script can now project rectangular launch zones from qualified compression bases after bullish or bearish ribbon launches. These are not generic support and resistance boxes. They are built from the internal EMA ribbon envelope formed during compression, which gives this script a more original identity and a cleaner post-launch roadmap.
2. Added a composite Launch Score
Compression, alignment, and directional pressure are now blended into a dedicated Launch Score. This helps filter weaker releases and highlights the launches that develop from stronger ribbon structure.
3. Upgraded the panel to the current AGPro visual format
The panel now uses the standardized merged blue header row, cleaner AGPro palette styling, adjustable location, adjustable font sizing, and a tighter premium layout. The data hierarchy is also improved with clearer State, Compression, Alignment, Pressure, Launch Score, Setup, and Zone status rows.
4. Improved event labeling
Release events are now presented as Bull Launch and Bear Launch, while compression events are presented as Coil Base. Label offsets were refined to keep labels clearer around candles and more visible in published chart previews.
5. Expanded settings with professional tooltips
Important inputs now include clearer English tooltips so the script is easier to configure directly from the TradingView settings panel.
6. Updated the title format
The published indicator title now follows the updated AGPro naming standard by removing the AG Pro prefix from the script title while keeping AG Pro branding inside the panel header.
Why this update matters
The previous version already mapped ribbon compression and expansion well, but it still behaved mostly like a refined ribbon-state reader. This update pushes the script further by adding projected launch-base structure, a stronger state hierarchy, and a more memorable chart presence.
Scope
This script remains a structural analysis tool. It is designed to help traders study compression, launch, expansion, and cooling behavior inside a multi-EMA ribbon with cleaner visual context and a more professional chart workflow.
Информация о релизе
🔧 UPDATE NOTES - v4.0This update focuses on chart readability and labeled launch zones.
The core purpose of the script remains unchanged.
This release improves how the existing ribbon, launch, and zone logic is 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
------------------------
- Cleaner default on-chart labeling
The default label density now shows launch events only, removing the label crowding and overlap that could appear when coil and launch labels printed close together. Coil context still appears in the panel, and additional label layers remain available as options.
- Labeled launch zones
Each projected launch zone now carries a single centered badge identifying it as a bullish or bearish launch base, so the zone is self-explanatory at a glance.
- Fewer overlapping zones by default
The default number of stored launch zones was reduced so the most recent, most relevant bases stand out instead of stacking on top of each other. This remains adjustable.
- Consistent short title
The chart short title was aligned with the rest of the series for consistent naming.
------------------------
Visual Improvements
------------------------
- Reduced visual clutter to enhance first-glance interpretation
- Refined visual hierarchy so launch events and launch bases stand out clearly
- Added centered, color-coded badges inside launch zones for instant context
- Kept the existing premium ribbon styling and color palette
------------------------
Interface & Usability
------------------------
- Optimized default label and zone settings for a more balanced appearance
- Preserved all existing inputs, themes, and toggles
- Improved on-chart readability without changing core logic
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The compression, alignment, pressure, and launch scoring, the state machine, and the launch-zone detection all behave exactly as before.
Users should interpret outputs the same way as before, with a cleaner and more labeled chart presentation.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical and visualization tool.
Market conditions such as volatility, liquidity, and timeframe differences may affect how compression, launches, and zones 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.
Информация о релизе
🔧 UPDATE NOTES - v4.1This is a minor maintenance update.
The core purpose of the script remains unchanged.
No analytical or visual behavior has been changed in this release.
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
------------------------
- Minor version maintenance and housekeeping. No changes to logic, visuals, inputs, or alerts.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The compression, alignment, pressure, and launch scoring, the state machine, and the launch-zone logic all behave exactly as before.
Users should interpret outputs exactly the same way as before.
------------------------
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.
Информация о релизе
🔧 UPDATE NOTES - 4.2This update focuses on readability, decision support, and clean label layout.
The core purpose of the script remains unchanged.
This release improves how the existing ribbon-compression logic is presented,
organized, and interpreted on the chart, and adds a stop-aware reference statistic
for launch follow-through.
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 Launch Follow Rate to the panel
A new statistic tracks how many past ribbon launches followed through by a target
distance in the launch direction before reversing to an opposite stop. Both levels
are frozen at the launch bar, samples are evaluated only on confirmed bars, and a
launch that neither reaches its target nor its stop within the follow-through window
times out without counting. The panel shows "Building (n)" until enough samples
exist, then a tier-colored percentage with the sample count.
• Improved on-chart text contrast
Every event label (launch, coil, stretch) and the launch-zone base label now use a
luminance-aware text color, so the text stays sharp on bright green, pink, and
indigo fills instead of washing out.
• Cleaner launch-zone base labels
When two launch bases sit close together, their centered labels are now separated
vertically so they no longer overlap and become unreadable.
• Hardened volatility reference
The ATR fallback now resolves to true range on the very first bars, keeping spacing
stable on freshly loaded or low-history symbols.
------------------------
Visual Improvements
------------------------
• Improved chart readability by recoloring all label text for proper contrast
• Reduced visual clutter by de-collising overlapping launch-zone base labels
• Refined the panel hierarchy so the new Follow Rate sits with the score rows
• Kept event-label spacing measured in ATR units so labels avoid candle overlap
------------------------
Interface & Usability
------------------------
• Optimized panel layout to surface launch context, quality, and follow-through together
• Improved label readability for clearer first-glance interpretation
• Adjusted default visual settings for a more balanced appearance
• Enhanced overall user experience without changing core logic
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The Launch Follow Rate is a descriptive, backward-looking statistic. It is not a
prediction and does not guarantee that any future launch will follow through.
Users should interpret outputs the same way as before, but with improved visual
structure and an added follow-through reference.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, and timeframe differences may
affect how launches, coils, and the Follow Rate 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.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.