INVITE-ONLY SCRIPT
Updated

Trendline Retest Execution Matrix [AGPro Series]

291
Trendline Retest Execution Matrix [AGPro Series]

🧠 Core Idea

After a trendline break, is the retest acting as execution context, failure pressure, or unresolved continuation review?


📌 Overview / What it does

Trendline Retest Execution Matrix is a post-break trendline workflow designed to evaluate what happens after an active trendline is broken.

The script maps the active trendline, break reference, retest pocket, failure boundary, break quality, retest depth, execution score, historical attention labels, and a compact workflow panel directly on the chart.

It does not attempt to predict direction, automate decisions, or provide guaranteed outcomes. It is designed as an analytical visualization layer for reviewing trendline break and retest behavior.


🎯 Purpose & Design Philosophy

Trendline breaks are easy to notice after they happen, but the retest phase is where interpretation often becomes difficult.

This script was built to organize the post-break phase into a structured workflow:

• Which trendline side was broken?
• Was the break strong or weak?
• Has the market returned into the retest pocket?
• Is the retest shallow, balanced, deep, or failing?
• Is execution readiness improving or weakening?

The goal is to help users separate a raw trendline break from the follow-up behavior around retest quality, failure pressure, and execution context.


⚡ Why This Script Is Different

Most trendline tools focus on drawing lines or detecting basic break events.

This script does NOT stop at the break.

Instead, it evaluates the post-break retest area by combining break quality, retest depth, distance from the break reference, failure pressure, and execution readiness into one structured matrix.

The result is not just an automatic trendline overlay. It is a post-break retest workflow designed to make the retest phase easier to review.


⚙️ Methodology

1. Trendline Context Detection

The script builds active trendline context from recent pivot highs and pivot lows.

2. Break Qualification

The script evaluates whether a bullish or bearish break is strong enough to activate the matrix.

3. Retest Pocket Mapping

After a break, the script projects a retest pocket around the broken trendline reference.

4. Failure Boundary Construction

The script maps a failure boundary beyond the retest pocket to monitor failed-retest pressure.

5. Execution Score Evaluation

Execution score combines break quality, retest depth, acceptance around the pocket, distance quality, and failure pressure.

6. Visual Output

The chart displays the active trendline, break reference, retest pocket, failure boundary, current review badge, historical labels, and workflow panel.


🗺️ How to Read the Chart

Active Trendline shows the recent trendline context that produced the break.

Break Reference marks the broken trendline level used as the central review reference.

Retest Pocket shows the active area where post-break retest behavior is evaluated.

Failure Boundary marks the area where failed-retest pressure begins to matter.

Current Review badge summarizes the active state, execution score, and failure risk.

Panel summarizes trendline side, break quality, retest state, failure risk, execution score, distance, state, and next action.


🚦 Signals & States

• BREAK CONFIRMED → a qualified trendline break context is active

• RETEST REVIEW → the market has returned into the retest pocket

• EXECUTION READY → retest behavior and execution score are strongly aligned

• FAILURE PRESSURE → pressure beyond the retest pocket is increasing

• FAILED RETEST → the active retest context has moved beyond the failure boundary

• AWAITING BREAK → no active qualified break context is dominant


🔔 Alerts Logic

Alerts are designed as attention markers.

They can trigger when:

• A qualified trendline break appears
• Retest review becomes active
• Failed retest state appears
• Execution score becomes elevated
• The staged workflow state changes

Alerts do not represent trade instructions or guaranteed outcomes.


🧩 Confluence Logic

The strongest review context appears when a qualified break is followed by a controlled retest into the pocket while failure pressure remains contained.

When break quality, retest depth, distance, and failure pressure align, the matrix can upgrade into an execution-ready review state.


📊 When to Use

This script is most useful when reviewing:

• Trendline break and retest behavior
• Continuation after a clean break
• Failed retest pressure
• Retest pocket quality
• Structure transitions around diagonal levels
• Breakout follow-up context


⚠️ When NOT to Use

Use extra caution in:

• Very low-liquidity markets
• Extremely noisy lower timeframes
• Abnormal gap conditions
• Disorderly news-driven movement
• Flat markets with weak pivot structure

Weak trendline structure can reduce the usefulness of any retest workflow.


🎛️ Key Inputs

• Matrix Mode → controls whether both directions, bullish breaks only, or bearish breaks only are evaluated

• Trendline Pivot Strength → controls the swing points used to build trendline context

• Quality Lookback → controls the baseline for range, body, and volatility measurements

• Break Sensitivity → controls how strict break qualification should be

• Retest Pocket Width → controls how wide the projected retest pocket is

• Failure Strictness → controls how quickly failure pressure increases

• Visual Preset → controls chart annotation density

• Panel Theme / Location / Font Size → controls dashboard presentation


🖥️ Interface & Visual Design

The interface is designed to keep the retest phase readable.

The active trendline remains visible but does not dominate the chart. The retest pocket carries the main visual focus, while the panel organizes the same context into a compact review workflow.

The goal is to make the break-reference, retest pocket, and failure boundary readable at first glance.


🧪 Practical Usage Workflow

1. Read the panel state.

2. Locate the active trendline and break reference.

3. Check whether the market has entered the retest pocket.

4. Review retest depth and failure risk.

5. Compare execution score with the active state.

6. Use alerts as attention markers, not automatic decisions.


🔍 Interpretation Guidelines

A high break quality score means the initial break had stronger structural characteristics.

A balanced retest depth means the market has returned into the pocket without immediately creating heavy failure pressure.

A high execution score means the post-break review factors are more aligned.

High failure risk means the active retest context should be interpreted carefully and re-evaluated within broader structure.


🚫 What This Script Is NOT

This script is not a prediction engine.

It is not an auto-trading system.

It is not a financial advice tool.

It does not guarantee break continuation.

It does not guarantee retest success.

It does not replace independent market analysis.


⚠️ Limitations & Transparency

Trendline behavior can vary by symbol, timeframe, volatility regime, and pivot structure.

Lower timeframes may produce more frequent state changes.

High volatility can expand pockets and increase review frequency.

The script is rule-based and should always be interpreted within broader market context.


🧠 Market Context Notes

A break alone is not enough.

The important question is what happens after the break:

• Does the market retest?
• Is the retest controlled?
• Does failure pressure appear?
• Does the retest pocket hold its structure?
• Does execution context strengthen or weaken?

This script was built around that follow-up question.


🧾 Use Case Examples

When a descending trendline is broken, the script can map a bullish retest pocket and begin tracking execution readiness.

When an ascending trendline is broken, the script can map a bearish retest pocket and monitor failure pressure.

When the market moves beyond the failure boundary, the state can shift into failed-retest review.


🧱 System Philosophy

Trendline Retest Execution Matrix follows the AGPro Series approach:

Turn a common chart event into a structured review process.

Instead of treating a trendline break as a conclusion, the script organizes the follow-up phase into zones, scores, labels, and next-action context.


🔐 Non-Promise Statement

The script does not promise certainty.

It does not claim future outcomes.

It provides a structured analytical view of trendline break, retest quality, failure pressure, and execution context.


📉 Risk Disclosure

Trading involves risk.

All outputs are for educational and analytical purposes only.

Users are responsible for their own decisions, risk management, and interpretation.

Nothing in this script should be considered financial advice.


📚 Educational Note

The script is intended to support structured learning around trendline break behavior, retest analysis, failure pressure, and staged chart interpretation.
Release Notes
🔧 UPDATE NOTES - V1.1

This update focuses on chart readability, retest-pocket clarity, label hierarchy, and panel usability.

The core purpose of the script remains unchanged.
This release improves how the existing trendline break and retest workflow 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 historical label filtering
Historical labels now use a higher default score threshold and a longer cooldown window. This helps reduce repeated retest labels while keeping important retest-ready, break-review, and failed-retest states visible.

• Added a richer active retest-pocket label
The active pocket label now combines trendline side, workflow state, execution score, retest depth, failure risk, and a compact setup-quality bar into one centered badge.

• Added setup quality context
A new setup-quality score summarizes execution score, break quality, retest quality, and failure-risk pressure into a single 0-100 reading.

• Added bars-active tracking
The panel now shows how many bars the active trendline retest workflow has been active, giving users a clearer sense of context age.

• Added failure distance context
Failure labels now include ATR distance from the failure boundary when the failure context is displayed.


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

• Reduced repeated historical labels by adjusting default filtering and cooldown behavior.

• Improved chart readability by combining the active-pocket summary into one stronger badge.

• Refined visual hierarchy so the trendline, break rail, retest pocket, failure boundary, and current review context are easier to scan.

• Adjusted label content density so the main workflow appears more organized without adding unnecessary clutter.


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

• Expanded the panel from the original workflow summary into an 11-row panel.

• Added Bars Active and Setup Quality as dedicated panel rows.

• Preserved the merged blue AG Pro panel header and existing theme, location, and font controls.

• Preserved label font-size control and default panel visibility.


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

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

The goal is to improve clarity, hierarchy, and usability around the existing trendline retest workflow.

Users should interpret outputs the same way as before, with improved visual structure and a more informative active-pocket summary.


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how trendlines, retest pockets, failure states, and execution-readiness 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 - v1.2

This update focuses on chart readability, label clarity, and presentation polish.

The core purpose of the script remains unchanged.
This release improves how the existing 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
------------------------

• Single on-chart decision card
The active status is now shown in one clean card that combines the trendline side and matrix state, execution score, retest depth, failure risk, setup quality, and the current next-step context.

• Removed redundant labels
Earlier versions showed several separate labels (current review, break) that repeated information already in the panel. These were consolidated to reduce visual noise.

• Cleaner failure label
The failure-distance label now sits on its own marker along the failure line, clearly separated from the main card on every timeframe.

• Adaptive label text contrast
Label text now adjusts automatically for readability across all state colors, including lighter backgrounds.

• Internal cleanup
Removed unused code paths for a lighter, faster script.


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

• Improved chart readability by consolidating status into one card

• Reduced visual clutter and removed overlapping labels

• Refined visual hierarchy so the card, the break level, and the failure level stand out clearly

• Adjusted positioning to avoid overlap with candles and between labels on all timeframes


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

• Clearer information flow between the panel and the on-chart card

• Improved label text contrast for easier reading on every state color

• Kept a balanced default annotation density for a clean, premium appearance

• Enhanced overall readability 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 usability, not to introduce new predictive behavior.

Trendline break detection, retest depth, failure pressure, scoring, and states behave the same as before, presented 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 labels 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.
Release Notes
UPDATE NOTES - 1.3

This update focuses on proof and decisiveness: a new Follow Rate layer shows
how often past trendline breaks actually carried price in the break
direction, every readout now speaks in clear trade decisions, and the matrix
honestly recognizes when price has drifted too far from the retest pocket to
act.

The core purpose of the script remains unchanged. It still maps active
trendline context, break quality, retest pocket behavior, failure pressure,
execution readiness and a next-action state.

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

- Follow Rate proof layer
A new panel row reports the historical follow rate of the trendline breaks on
the chart: the share of past breaks after whose confirmation price traveled
one anchor-ATR in the break direction before closing back through the failure
boundary, with the sample size (n). Each break is registered once at its
confirmation bar - the break close, the first moment the break is actually
visible - and same-bar conflicts resolve conservatively as failures, so the
statistic is an honest record of how breaks on this chart typically resolved.
The row stays muted until enough breaks have resolved, so a thin sample is
never presented as a strong result. Once the sample is ready, the on-chart
pocket label carries the follow rate as well.

- Decision-language next action
The Next Action row and the action line on the pocket label now speak in
trade decisions - trade the retest, prepare retest entry, wait for retest,
abort / stand aside, stand by / zone far, wait / new break - instead of
generic review prompts.

- Distance-aware standby state
A new POCKET DISTANT state activates when price sits beyond a configurable
Pocket Reach (in anchor-ATR units, default 3.0) from the retest pocket
without a retest in progress. The next action then reads "Stand by / Zone
far" instead of an open-ended wait, so the readout always matches what the
chart actually shows. The new Pocket Reach (ATR) input controls this
threshold.

- Decisive state names
Workflow states were renamed to describe what is happening rather than asking
for a review: RETEST ACTIVE replaces the previous review wording, and chart
history labels now read RETEST READY, RETEST, FAILED RETEST and BREAK
CONFIRMED. Alert names are unchanged, so existing alerts keep working.

- Context-aware pocket label with clean numeric readouts
All scores now display as plain numbers in both the panel and the on-chart
pocket label; decorative gauge characters were removed. Before a retest
begins, the label's score line reports the live distance to the pocket
instead of printing structurally empty retest and failure zeros; it switches
to a score-and-failure readout while failure pressure builds, and to the full
retest and failure readout once a retest is in progress.


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

- The failure badge is now anchored to the right edge of the pocket
projection, pointing at the failure boundary line, so it can no longer
overlap the pocket label or candles on any timeframe or zoom level. It is
hidden once a retest has already failed, where the distance readout no longer
carries meaning.

- Historical state labels now clear the surrounding candle cluster rather
than only their own bar, so labels no longer sink into taller neighboring
candles, and every history label carries a pointer toward its candle.

- The distant standby state renders in a muted slate tone in the panel and on
the pocket label, and the Distance row dims when price is beyond pocket
reach, so an out-of-reach setup is visually distinct at first glance.

- Refined visual hierarchy so the verdict, the scores, the proof and the next
action each read clearly at a glance.


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

- Added the Pocket Reach (ATR) input with a clear tooltip; all other break,
pocket, failure, visual and panel settings remain available and unchanged.

- Enhanced overall user experience while keeping panel theme, location and
font size fully adjustable, with the panel shown by default.


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

This update adds a break tracking layer, a distance gate and clearer state
language on top of the existing logic. The trendline construction, break
detection, pocket geometry, retest depth, failure pressure and scoring are
unchanged.

The goal is to improve clarity, depth and decisiveness, not to introduce
predictive behavior. The Follow Rate describes how past breaks resolved
within the visible history and is not a forecast; POCKET DISTANT describes
the current distance between price and the pocket, not whether a retest will
occur. Small samples should be read with care.


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

The script remains a rule-based analytical tool.

Follow rates, pocket reach and state timing vary with timeframe, instrument,
pocket width and settings. A favorable reading does not guarantee any
individual outcome.

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 break reliability, retest timing, failure-pressure accuracy, state continuity, analytical clarity, and cross-theme usability.

The core purpose of the script remains unchanged.
This release improves how the existing trendline-break and retest workflow is registered, maintained, 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
------------------------

• Confirmed trendline context and break registration
New pivot references and qualified breaks are now registered only after candle confirmation. An unfinished candle can no longer replace the active break level, side, ATR anchor, or trendline geometry.

• Genuine post-break retest timing
The breakout candle itself can no longer be classified as its own retest. Pocket interaction begins only on bars after the confirmed break.

• Functional failure-pressure stage
Failure pressure now rises as price moves from the relevant pocket edge toward the failure boundary. The FAILURE PRESSURE state is measurable before terminal failure instead of remaining effectively unreachable.

• Terminal failed-retest continuity
Once a confirmed close fails the active retest context, FAILED RETEST remains active until a new confirmed break is registered. The same failed context can no longer return to an active or ready state after price moves back inside the pocket.

• Consistent retest-state reporting
The Retest State row now reports FAILED RETEST when terminal failure is active, matching the main workflow state and active chart card.

• Deterministic dual-side handling
If bullish- and bearish-break conditions occur on the same candle, normalized break distance and close location determine the selected side instead of applying a fixed bullish preference.

• Honest pre-break state
Before the first confirmed break, the panel displays AWAITING BREAK and neutral placeholders rather than presenting a synthetic active setup.

• Confirmed tracking and alerts
Follow-rate observations resolve on confirmed candles, and all break/state alerts require candle confirmation.

• Analytical review language
Direct execution phrases were replaced with neutral review prompts. The final panel row is now Next Review rather than Next Action.


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

• Preserved the established premium active trendline, break reference, retest pocket, failure boundary, centered decision card, historical labels, and panel identity

• Prevented recent historical labels from competing with the active projected pocket card

• Retained meaningful older state labels outside the active projection area

• Corrected theme-aware panel value and thin-sample colors for Dark and Light panel themes

• Added neutral placeholders before a valid break exists, reducing misleading chart output


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

• Renamed the final panel row to Next Review for clearer analytical intent

• Replaced direct trade commands with contextual review prompts

• Improved failed-state consistency across the Retest State row, workflow state, and active chart card

• Preserved panel show/hide, location, theme, font-size, label-size, and visual-density controls

• Retained the single merged blue panel header and existing AGPro visual hierarchy


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

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

The matrix still builds active trendline context from confirmed pivots, qualifies breaks, projects a retest pocket and failure boundary, evaluates break quality and retest behavior, and summarizes the active context through lines, zones, labels, alerts, and the panel.

Because unfinished candles no longer register new breaks or state alerts, a state may appear later than it did intrabar in the previous version. This is intentional and improves reliability; it is not a new predictive behavior.

Follow Rate summarizes confirmed, non-overlapping resolved observations. It remains descriptive context, not a forecast or probability promise.


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

The script remains a rule-based analytical tool.

Trendline geometry and retest behavior can vary with symbol, timeframe, volatility, gaps, liquidity, pivot structure, pocket width, and the amount of loaded history.

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, automated execution, guaranteed signals, or guaranteed trading outcomes.

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

• Refreshed the publication and access routing information.
• Core trendline-retest logic, panel behavior, inputs, alerts, visuals, and outputs remain unchanged.
Release Notes
🔧 UPDATE NOTES - V1.6.0

This update focuses on evidence quality, panel hierarchy, chart readability, and overlap control.

The core purpose of the script remains unchanged. The matrix still evaluates confirmed trendline breaks, retest-pocket interaction, failure pressure, and the current review state. This release improves how historical evidence and active-chart context are presented.

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


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

• Added a one-sided 90% Wilson confidence floor
The observed historical follow rate is now accompanied by a conservative lower confidence bound, preventing small samples from appearing as mature evidence.

• Added sample-quality reporting
The panel now separates observed follow rate, confidence floor, and sample maturity.

• Refined the active retest badge
The active zone badge now uses a compact three-line hierarchy for side/state, readiness/risk/quality, and historical evidence.

• Reframed execution language
The panel now uses “Retest Readiness” and neutral review language to keep the output analytical rather than instructional.

• Added the AGPro core-question row
The panel now asks: “IS THIS BROKEN TRENDLINE HOLDING?”


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

• Centered the active badge within the projected retest pocket

• Increased horizontal separation between the retest badge and failure-edge badge

• Reduced retest-pocket fill dominance for clearer candle visibility

• Uses a muted failure-edge badge while risk remains low, reserving red emphasis for elevated failure pressure

• Preserved contrast-safe text across Dark and Light panel themes


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

• Expanded the panel without widening its core two-column layout

• Separated observed evidence from conservative evidence

• Improved first-glance hierarchy: question → current structure → evidence → review state

• Preserved adjustable panel location, panel theme, panel visibility, panel font size, and label font size


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

The underlying trendline-break and retest-state workflow remains intact.

Historical follow observations still resolve conservatively: failure and timeout take precedence over a same-bar favorable move.

The added confidence floor does not change price detection. It changes how statistical evidence is qualified and displayed.


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

Trendline construction depends on confirmed pivots and may vary across symbols and timeframes.

Volatility, liquidity, gap behavior, and market structure can materially affect retest behavior.

Historical follow evidence describes resolved observations under the current settings; it does not guarantee future outcomes.


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

This script is for educational and analytical purposes only.

It does not provide financial advice, automated trading, or guaranteed signals.

Users remain responsible for their own decisions and risk management.
Release Notes
Version 1.7.0 – Retest Lifecycle Clarity

This update strengthens the visual distinction between the active retest workflow and prior break events while preserving the confirmed-pivot trendline engine, break and retest calculations, failure lifecycle, confidence-qualified follow evidence, and alert behavior.

• Rebuilt the centered retest-pocket badge with a shorter three-line hierarchy, making direction, workflow state, readiness, failure risk, setup quality, observed follow rate, and Wilson floor easier to scan without covering unnecessary chart space.

• Added explicit PRIOR BREAK ownership to every historical lifecycle label, preventing older RETEST READY and FAILED RETEST records from being mistaken for the current setup.

• Added font-size-aware ATR clearance to historical labels, improving separation from candle clusters when Small, Normal, or Large label text is selected.

• Expanded the right-edge label to FAILURE EDGE and added font-size-aware horizontal spacing, preserving exact boundary ownership while reducing collision risk at larger text sizes.

• Converted the panel State value into a state-colored answer cell, making the response to “IS THIS BROKEN TRENDLINE HOLDING?” visible at first glance on both Dark and Light panel themes.

• Removed the obsolete compact-state formatter after the active badge moved to full workflow-state names, keeping the presentation path leaner without changing state logic.

• Preserved the active trendline, break reference, retest-pocket geometry, terminal failed-retest behavior, Break Quality, Retest Readiness, Sample Quality, observed Follow Rate, one-sided 90% Wilson floor, and all five alert conditions.

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.