OPEN-SOURCE SCRIPT
Actualizado AG Pro Correlation Breakdown Map [AGPro Series]

AG Pro Correlation Breakdown Map [AGPro Series]
Overview / What it does
AG Pro Correlation Breakdown Map is an overlay indicator designed to monitor whether a chart symbol is maintaining, weakening, breaking, or repairing its relationship with a benchmark symbol.
The default benchmark in this version is Bitcoin via BINANCE:BTCUSDT, which makes the tool especially useful for crypto traders who want to understand whether an altcoin is still moving in line with BTC or beginning to decouple from it.
This script does not attempt to answer whether correlation is simply high or low in isolation. Its purpose is more specific: it first checks whether a meaningful benchmark relationship existed, then evaluates whether that relationship is starting to deteriorate, whether the deterioration is becoming a confirmed breakdown, and whether the relationship is later stabilizing again.
The result is a regime-style map that helps users read benchmark dependency through distinct states such as coupled, strained, breaking, broken, repairing, and recoupled. This makes the script useful for contextual analysis, benchmark-relative behavior studies, and chart review workflows where users want more than a single rolling-correlation number.
Unique Edge
The main difference of this script is that it is not a generic correlation line, not a spread-trading engine, and not a simple benchmark overlay.
Its focus is the structure of relationship failure.
Instead of only plotting short-term correlation, the script combines four layers:
1. prior relationship validation,
2. short-vs-long correlation deterioration,
3. independent price behavior,
4. persistence and repair logic.
That combination is what separates a temporary wobble from a more meaningful benchmark breakdown event.
This also makes the script distinct from tools that measure correlation pressure or synchronized stress. Correlation Breakdown Map is built around the question: “A relationship existed before, but is it now failing, and if so, how cleanly?”
Methodology
The script starts by selecting a benchmark series and transforming price data into returns. Users can choose between log returns and percent returns.
A short correlation window and a long correlation window are then calculated between the chart symbol and the benchmark. The long window is used to judge whether a stable benchmark relationship has existed, while the short window is used to detect more recent deterioration.
The model then evaluates the gap between long and short correlation, along with short-correlation slope behavior. A benchmark relationship is considered more vulnerable when the short window weakens materially relative to the long window and the short-correlation slope also softens.
To avoid treating every statistical wobble as a true event, the script also checks for independent price behavior. This layer measures whether the chart symbol is beginning to move in a way that is meaningfully different from the benchmark over a configurable lookback period.
Finally, persistence and repair conditions are applied. This allows the script to separate brief instability from a more durable breakdown state, and later identify whether the relationship is beginning to normalize again.
Signals & Alerts / States
This script is primarily a state-mapping tool rather than a directional buy/sell engine.
The core states are:
Coupled
The chart symbol remains meaningfully aligned with the benchmark relationship structure.
Strained
The prior relationship still exists, but weakness is starting to appear.
Breaking
The relationship is under active deterioration and may be transitioning into a more meaningful failure.
Broken
The chart symbol is behaving as if benchmark linkage has materially weakened.
Repairing
The breakdown is no longer cleanly expanding, and the relationship may be stabilizing.
Recoupled
The benchmark relationship has improved enough to suggest that the prior structure is functioning again.
The Breakdown Score is used as a compact summary value. It is not intended to be interpreted as a trade signal on its own. It is a regime-strength readout that helps users compare the current condition of the relationship with the underlying state labels.
Key Inputs
Benchmark Symbol
Sets the comparison symbol. The default is BINANCE:BTCUSDT.
Benchmark Timeframe
Allows users to keep the benchmark on chart timeframe or compare against another timeframe.
Source
Selects Close, HLC3, or OHLC4 for the benchmark study.
Short Correlation Length / Long Correlation Length
Define the fast and slow windows used to evaluate current deterioration versus prior relationship structure.
Stable Relationship Threshold
Controls how strong the historical relationship must be before the script treats later weakness as a true breakdown candidate.
Breakdown Threshold / Repair Threshold
Control how strict the transition logic is for deterioration and recovery.
Min Long/Short Correlation Gap
Requires a meaningful difference between longer-term and shorter-term correlation before escalation.
Independent Move Threshold
Defines how much benchmark-relative price independence is required before the script treats the event as more than a statistical fluctuation.
Breakdown Confirmation Bars / Repair Confirmation Bars
Control persistence and confirmation sensitivity.
Visual Settings
Users can customize theme, visual intensity, panel font size, panel position, event visibility, trail visibility, and chart context density.
Limitations & Transparency
Correlation is a descriptive relationship metric, not a causal model.
A relationship breakdown does not automatically imply immediate continuation, reversal, trend acceleration, or trade opportunity. It only means the chart symbol is no longer behaving as consistently relative to the selected benchmark under the current settings.
Different assets, timeframes, and volatility regimes can produce different correlation behavior. A benchmark relationship that looks stable on one timeframe may be much less stable on another.
Short lookbacks can react faster but may create more noise. Longer lookbacks can be more stable but slower to react.
This script should be interpreted in the context of market structure, volatility, liquidity, and the chosen benchmark. It is a framework for reading relationship quality, not a guarantee engine.
Risk Disclosure
This indicator is for analytical and educational use.
It does not provide financial advice, does not predict future price direction, and should not be used in isolation for trading decisions. Users should perform their own analysis, validate settings on the markets they follow, and apply appropriate risk management.
Overview / What it does
AG Pro Correlation Breakdown Map is an overlay indicator designed to monitor whether a chart symbol is maintaining, weakening, breaking, or repairing its relationship with a benchmark symbol.
The default benchmark in this version is Bitcoin via BINANCE:BTCUSDT, which makes the tool especially useful for crypto traders who want to understand whether an altcoin is still moving in line with BTC or beginning to decouple from it.
This script does not attempt to answer whether correlation is simply high or low in isolation. Its purpose is more specific: it first checks whether a meaningful benchmark relationship existed, then evaluates whether that relationship is starting to deteriorate, whether the deterioration is becoming a confirmed breakdown, and whether the relationship is later stabilizing again.
The result is a regime-style map that helps users read benchmark dependency through distinct states such as coupled, strained, breaking, broken, repairing, and recoupled. This makes the script useful for contextual analysis, benchmark-relative behavior studies, and chart review workflows where users want more than a single rolling-correlation number.
Unique Edge
The main difference of this script is that it is not a generic correlation line, not a spread-trading engine, and not a simple benchmark overlay.
Its focus is the structure of relationship failure.
Instead of only plotting short-term correlation, the script combines four layers:
1. prior relationship validation,
2. short-vs-long correlation deterioration,
3. independent price behavior,
4. persistence and repair logic.
That combination is what separates a temporary wobble from a more meaningful benchmark breakdown event.
This also makes the script distinct from tools that measure correlation pressure or synchronized stress. Correlation Breakdown Map is built around the question: “A relationship existed before, but is it now failing, and if so, how cleanly?”
Methodology
The script starts by selecting a benchmark series and transforming price data into returns. Users can choose between log returns and percent returns.
A short correlation window and a long correlation window are then calculated between the chart symbol and the benchmark. The long window is used to judge whether a stable benchmark relationship has existed, while the short window is used to detect more recent deterioration.
The model then evaluates the gap between long and short correlation, along with short-correlation slope behavior. A benchmark relationship is considered more vulnerable when the short window weakens materially relative to the long window and the short-correlation slope also softens.
To avoid treating every statistical wobble as a true event, the script also checks for independent price behavior. This layer measures whether the chart symbol is beginning to move in a way that is meaningfully different from the benchmark over a configurable lookback period.
Finally, persistence and repair conditions are applied. This allows the script to separate brief instability from a more durable breakdown state, and later identify whether the relationship is beginning to normalize again.
Signals & Alerts / States
This script is primarily a state-mapping tool rather than a directional buy/sell engine.
The core states are:
Coupled
The chart symbol remains meaningfully aligned with the benchmark relationship structure.
Strained
The prior relationship still exists, but weakness is starting to appear.
Breaking
The relationship is under active deterioration and may be transitioning into a more meaningful failure.
Broken
The chart symbol is behaving as if benchmark linkage has materially weakened.
Repairing
The breakdown is no longer cleanly expanding, and the relationship may be stabilizing.
Recoupled
The benchmark relationship has improved enough to suggest that the prior structure is functioning again.
The Breakdown Score is used as a compact summary value. It is not intended to be interpreted as a trade signal on its own. It is a regime-strength readout that helps users compare the current condition of the relationship with the underlying state labels.
Key Inputs
Benchmark Symbol
Sets the comparison symbol. The default is BINANCE:BTCUSDT.
Benchmark Timeframe
Allows users to keep the benchmark on chart timeframe or compare against another timeframe.
Source
Selects Close, HLC3, or OHLC4 for the benchmark study.
Short Correlation Length / Long Correlation Length
Define the fast and slow windows used to evaluate current deterioration versus prior relationship structure.
Stable Relationship Threshold
Controls how strong the historical relationship must be before the script treats later weakness as a true breakdown candidate.
Breakdown Threshold / Repair Threshold
Control how strict the transition logic is for deterioration and recovery.
Min Long/Short Correlation Gap
Requires a meaningful difference between longer-term and shorter-term correlation before escalation.
Independent Move Threshold
Defines how much benchmark-relative price independence is required before the script treats the event as more than a statistical fluctuation.
Breakdown Confirmation Bars / Repair Confirmation Bars
Control persistence and confirmation sensitivity.
Visual Settings
Users can customize theme, visual intensity, panel font size, panel position, event visibility, trail visibility, and chart context density.
Limitations & Transparency
Correlation is a descriptive relationship metric, not a causal model.
A relationship breakdown does not automatically imply immediate continuation, reversal, trend acceleration, or trade opportunity. It only means the chart symbol is no longer behaving as consistently relative to the selected benchmark under the current settings.
Different assets, timeframes, and volatility regimes can produce different correlation behavior. A benchmark relationship that looks stable on one timeframe may be much less stable on another.
Short lookbacks can react faster but may create more noise. Longer lookbacks can be more stable but slower to react.
This script should be interpreted in the context of market structure, volatility, liquidity, and the chosen benchmark. It is a framework for reading relationship quality, not a guarantee engine.
Risk Disclosure
This indicator is for analytical and educational use.
It does not provide financial advice, does not predict future price direction, and should not be used in isolation for trading decisions. Users should perform their own analysis, validate settings on the markets they follow, and apply appropriate risk management.
Notas de prensa
UPDATE NOTES - V1.2This update focuses on visual presentation, readability, and chart comfort.
The core objective of this revision was to make the script look cleaner, more intentional, and easier to read on live charts without reframing the tool or changing its documented purpose. The state model remains centered on relationship qualification, deterioration, breakdown, repair, and recoupling behavior relative to the selected benchmark. This update is primarily about how that information is presented on the chart.
What changed
1) Coupled-context visuals were redesigned
The prior coupled display could look too segmented or visually detached from price in some market structures. In this revision, the coupled-state presentation was rebuilt into a smoother, more eye-friendly lane that sits closer to price and feels more integrated with the chart. The result is a cleaner visual rhythm during normal coupled periods.
2) The chart overlay was made more balanced
The visual stack was simplified so the indicator feels less heavy while remaining visible. The updated lane structure is intended to preserve context without overwhelming candles or creating unnecessary visual noise. This helps the script remain easier to follow across trending and consolidating environments.
3) The active-state presentation was refined
The right-edge state tag now sits more naturally with the visual lane and reads more like part of the overlay rather than a separate floating element. This improves visual coherence, especially when the chart is viewed quickly or from a distance.
4) Breakdown-path readability was improved
Breakdown and recovery visuals were kept distinct, but the overall rendering was tuned to feel smoother and more organized. The goal was not to add more decoration, but to improve the visual hierarchy between ordinary coupled behavior and more important fracture or repair phases.
5) General visual comfort was prioritized
Line weight, spacing, and overlay balance were adjusted so the script feels more premium and less tiring to watch over time. This was especially important for users who keep the indicator on chart for extended sessions.
What did not change
- The script is still a benchmark-relationship map, not a prediction engine.
- The underlying breakdown / repair framework was not redefined for this visual revision.
- The update does not turn the script into a standalone trading signal tool.
- The documented alert structure and state logic were not repositioned as guaranteed trade instructions.
Practical effect
In practical use, the script should now feel more polished during coupled periods, easier to read during transitions, and more comfortable overall when left on chart. The revision is intended to improve visual clarity and user experience rather than to make exaggerated claims about forecasting or outcome quality.
Risk and usage note
This script is designed as a contextual relationship tool. It should be used with broader chart structure, risk management, and independent confirmation. Like any correlation-based framework, it can become less informative when benchmark relationships are unstable, regime conditions shift rapidly, or price behavior becomes unusually noisy.
Notas de prensa
Update Notes - V1.3This update focuses on visual refinement, panel standardization, and cleaner state presentation.
What changed
- Reworked the summary panel into the current AG Pro layout.
- Applied the standardized blue single-row header format.
- Simplified the top panel row so it shows only the script name.
- Optimized default panel readability with Small panel font sizing.
- Kept label sizing aligned with the current AG Pro visual standard.
- Refined the coupled-state trail so price remains easier to read.
- Softened the visual weight of the correlation context structure.
- Improved chart cleanliness by reducing unnecessary visual pressure.
- Preserved the core breakdown / repair logic while improving presentation quality.
- Maintained alert and state behavior without introducing promotional or exaggerated claims.
Notes
- This script is designed to visualize changes in the relationship between the active chart and the selected benchmark.
- It does not forecast future price direction.
- It should be used as a contextual analysis tool, not as a standalone trading system.
Risk Disclosure
This script is provided for analytical and educational use only. It is not financial advice, and all market decisions remain the responsibility of the user.
Notas de prensa
Update Notes v1.4Correlation Breakdown Map has been refined to make benchmark decoupling easier to spot at a glance while keeping the chart cleaner, sharper, and more publication-ready. This update focuses on stronger visual hierarchy, clearer fracture lifecycle mapping, and a more distinctive identity inside the AGPro lineup.
- Reframed the public title to `Correlation Breakdown Map [AGPro Series]` while keeping `AG Pro` only inside the panel header.
- Added `Fracture Pocket Zones` to archive recent benchmark breakdown windows as clean rectangle zones instead of relying only on cloud-style emphasis.
- Reworked the visual stack with the AGPro palette, a stronger merged blue header row, and a cleaner state hierarchy for screenshots and live chart review.
- Upgraded the settings layer with professional English tooltips, `Normal` as the default panel font size, and tighter label-density controls through cooldown and max-visible limits.
- Strengthened the breakdown score with persistence awareness so short-lived noise is less likely to look as important as a confirmed fracture.
- Fixed the temporary event window lifecycle so the optional live box is deleted correctly after the active fracture phase ends.
Positioning:
This script remains centered on benchmark relationship failure, decoupling pockets, and repair structure. It is not a generic rolling-correlation display, not a synchronized stress model, and not a relative-strength leadership map. The focus stays on one question: a relationship existed before, but is it now fracturing, broken, or repairing in a way that matters?
Notas de prensa
🔧 UPDATE NOTES - V1.5This update focuses on readability, structure, visual clarity, and publication-grade usability.
The core purpose of the script remains unchanged.
This release improves how benchmark relationship deterioration, fracture confirmation, relative drift, and repair attempts 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 an active correlation fracture pocket.
Breaking, Broken, and Repairing states now create a cleaner projected pocket with centered text and a midpoint guide.
• Added a clearer decision-style panel.
The panel now emphasizes State, Breakdown Score, Short/Long Correlation, Relative Drift, and Action instead of a long diagnostic table.
• Added right-side context tags.
The chart now displays compact tags for breakdown score, short correlation, relative drift, and current action context.
• Improved fracture memory zones.
Completed fracture pockets can now remain on the chart as faded memory zones for better structural context.
• Refined event labeling.
Transition labels are more selective and controlled by density settings to reduce clutter while preserving a premium chart layout.
------------------------
Visual Improvements
------------------------
• Improved chart readability by adjusting the breakdown backbone, fracture pocket, right-side tags, and event label spacing.
• Reduced visual clutter by using selective labels and limited archived pockets.
• Refined visual hierarchy so relationship state, breakdown score, relative drift, and repair context stand out more clearly.
• Adjusted positioning of elements to avoid overlap with candles and improve first-glance interpretation.
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow.
• Added configurable panel visibility, panel location, panel theme, panel font size, and label font size.
• Kept label text size default at Normal for better chart readability.
• Enhanced overall user experience without changing the script into an automated signal system.
------------------------
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 as benchmark-relationship context:
prior coupling, correlation fracture, independent drift, breakdown confirmation, repair attempts, and recoupling.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, timeframe differences, benchmark selection, and sudden news-driven moves may affect how breakdown 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.
Notas de prensa
UPDATE NOTES - V1.6This update focuses on readability, fracture-pocket presentation, panel hierarchy, and chart interpretation.
The core purpose of the script remains unchanged.
This release improves how the existing correlation-breakdown 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
------------------------
* Refined the fracture-pocket visual layer.
The active pocket now uses a centered solid inner label box instead of relying on transparent zone text.
* Improved light-theme readability.
Pocket labels now remain inside their own contrast-safe box so the zone story is easier to read across common chart themes.
* Rebuilt the panel information flow.
The dashboard now prioritizes workflow, state, breakdown score, correlation, correlation gap, relative drift, and review view.
* Added clearer action-oriented workflow language.
States now use neutral review wording such as CHECK BREAK, CONFIRM FRACTURE, TRACK REPAIR, REVIEW STRAIN, MONITOR LINK, and WAIT LINK.
* Expanded panel location control.
Top center and bottom center placement options were added for better layout flexibility.
------------------------
Visual Improvements
------------------------
* Improved chart readability by keeping pocket labels inside solid inner boxes.
* Reduced dependency on transparent text over zones.
* Refined label wording so chart events are shorter and easier to scan.
* Adjusted right-side tags to use clearer uppercase review language.
* Increased default right-side tag spacing so score, correlation, drift, and workflow tags remain separated on higher timeframes.
* Increased event-label spacing from candles to improve readability on higher-timeframe charts.
------------------------
Interface & Usability
------------------------
* Optimized panel layout for faster relationship-breakdown review.
* Preserved panel controls for visibility, location, theme, and font size.
* Preserved chart label font-size control and applied it across labels, tags, and pocket text.
* Adjusted the default event-label density to provide a fuller chart story without changing the core model.
* Improved the visual hierarchy without changing the underlying analytical model.
------------------------
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 and cleaner workflow language.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, benchmark selection, and timeframe differences may affect how states 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.
Notas de prensa
🔧 UPDATE NOTES - 1.7This update adds a break-hold proof layer, removes a recommended-timeframe panel
row, improves text contrast, and cleans internal spacing. The core correlation
breakdown engine, lifecycle states and scoring remain unchanged. This script
continues to function as an analytical visualization tool. It does not predict
price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
- Break-Hold Proof Layer
The panel now tracks how often a confirmed fracture stayed decoupled through a
defined window before short correlation reclaimed the repair threshold, with
sample size shown.
- Thesis-Aligned Statistic
The proof reflects the script's core idea - a fracture that persists versus one
that quickly recouples - by measuring the repair threshold directly.
- Honest, Non-Repaint Statistics
Each confirmed fracture is counted once. Samples are confirmed-bar gated,
reclaiming the repair threshold inside the window counts as a recouple, and the
rate is built from completed windows only so it is not inflated.
- Cleaner Panel
Replaced the recommended-timeframe row with the Break Hold proof row for a more
focused, decision-first panel.
- New Proof Input
A dedicated proof group adds Proof Hold Window Bars so the hold test can be tuned
per market and timeframe.
------------------------
Visual Improvements
------------------------
- Improved event label, tag and pocket text contrast through a single luminance
model for amber, pink, indigo and teal elements
- Standardized internal spacing to volatility-based minimums for consistent
placement across symbols and price scales
- Kept the premium fracture pocket, backbone, context cloud and archived memory
zones intact
- No added chart clutter from the proof layer
------------------------
Interface & Usability
------------------------
- Added a Break Hold proof row to the relationship panel
- Improved first-glance trust with a visible track-record context
- Kept all existing settings and defaults backward compatible
- Enhanced overall experience without changing the core engine
------------------------
Behavior Notes
------------------------
This update does not change how correlation, the breakdown model, lifecycle states
or the score are computed. The goal is added proof context, cleaner contrast and a
more focused panel. Outputs should be interpreted the same way as before.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool. Volatility, liquidity, benchmark
selection and timeframe differences can affect how fractures and statistics
appear. Always interpret outputs 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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
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
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
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
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.