OPEN-SOURCE SCRIPT
Aktualisiert

MTF Trend Agreement Map [AGPro Series]

795
MTF Trend Agreement Map [AGPro Series]

🔹 **Overview**

MTF Trend Agreement Map is a multi-timeframe alignment engine that reads the trend across five timeframes at once and distills the result into a single transparent agreement score. Instead of forcing you to flip between charts, the map tells you, on every bar, how many timeframes agree, which side wins, and whether the market is in a locked regime, a forming trend, or a conflict phase. It is built for swing traders, HTF-bias scalpers, position traders, and anyone who uses top-down analysis as part of their process.

🔸 **What Makes It Different**

Most MTF indicators show a single method (usually a moving-average cross) repeated across timeframes, which means five rows that all agree with each other by construction. This map does something different: for each timeframe it runs three independent methods — an EMA regime filter, a pivot-based market-structure read (HH/HL vs LH/LL), and a normalized momentum slope — and blends their individual votes into the final score. You see not only the agreement across timeframes but also the agreement across methods, which exposes weak or borderline regimes that a single-method tool would quietly hide.

🔺 **Methodology**

• EMA Trend: a timeframe is bullish when EMA50 is above EMA200 and price is above EMA50; bearish on the mirror condition; neutral otherwise.
• Market Structure: confirmed pivots are tracked in real time. A timeframe is bullish while the last two confirmed swings form higher highs and higher lows, bearish on lower highs and lower lows.
• Momentum Slope: the change in linear regression across a configurable lookback, normalized by ATR so that fast and slow assets are comparable.
• Consensus per timeframe: each active method casts a vote; bulls minus bears determines the row's net direction and strength.
• Overall alignment: bull and bear votes are summed across all active timeframes; the dominant side's share defines the agreement percentage.

◆ **Three-State Regime Engine**

• **LOCKED** — agreement above the strong threshold (default 80%). High-conviction regime, continuation-friendly, background tint activates.
• **TRENDING** — agreement between 50% and the strong threshold. Directional bias forming but not yet fully aligned. Trade with reduced size or wait for confirmation.
• **SPLIT** — agreement below 50%. Timeframes are in conflict, no majority side. Classic chop phase, favors mean-reversion strategies or standing aside.

🔔 **Signals & Alerts**

• Regime Lock (Bull or Bear): fires the first bar agreement crosses above the strong threshold while one side dominates. Designed as a continuation trigger, not a reversal signal.
• Chop / Conflict: fires when no side holds the majority, a classic filter for mean-reversion systems or a stand-aside cue for trend traders.
• Both generic and directional alertcondition() hooks are exposed so you can wire the map into automations.

⚙️ **Key Inputs**

• Core Engine: toggle any of the three methods on or off, and tune the pivot length and momentum lookback independently.
• Timeframes: four user-selected timeframes plus an optional Current row that auto-adapts to the chart TF. If the chart TF matches any selected TF, the Current row is hidden automatically to avoid double-counting.
• Panel: six location presets, four text sizes (default Normal), dark or light theme, optional per-method breakdown row.
• Background Tint: enable or disable, set the strong-alignment threshold (50–95%) and control transparency (70–99) to keep the chart premium.

📖 **How to Use**

• Top-down confirmation: take trades on your execution timeframe only when the higher rows in the map agree with your thesis.
• Regime filter: enable Regime Lock alerts to catch moments when the full map snaps into alignment — these are typical continuation windows.
• Conflict filter: when the map prints SPLIT, widen stops, reduce size, or step aside; trend strategies historically underperform during these phases.
• Method debugging: turn on the per-method breakdown to see which methods are driving the score and which are fighting it.

⚠️ **Limitations & Transparency**

• All timeframe values are non-repainting at bar close (lookahead is disabled), but intrabar values can update until the parent bar closes — this is expected MTF behavior.
• Market Structure requires enough history on each timeframe to confirm two swings; on very young assets or short charts the structure vote may be neutral until pivots print.
• The map is a context tool, not a standalone entry system — combine it with your own execution logic, risk management, and bias.

📌 **Risk Disclosure**

This script is provided for educational and analytical purposes only. It does not constitute financial advice, a recommendation, or a solicitation to trade any instrument. Markets involve substantial risk and past behavior does not guarantee future results. Always do your own research and manage risk responsibly.
Versionshinweise
🔧 UPDATE NOTES - V1.5

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

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

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


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

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

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

• Refined the agreement state model.
The script now separates LOCKED, TRENDING, SPLIT, and WAIT states more clearly through panel text, color, and labels.

• Added controlled regime labels.
Labels appear only when the agreement state changes, with spacing and retention controls to avoid overcrowding.

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


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

• Improved chart readability by adding the agreement ribbon, ribbon fill, and clearer state colors.

• Reduced visual clutter by keeping regime labels spacing-controlled and bounded.

• Refined visual hierarchy so the alignment score, dominant side, and timeframe rows are easier to scan.

• Adjusted positioning of elements to avoid relying on background tint as the only visual signal.


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

• Optimized panel layout for clearer information flow.

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

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

• Enhanced overall user experience without changing the core multi-timeframe agreement logic.


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

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

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

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


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and higher-timeframe confirmation delay may affect how agreement 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.
Versionshinweise
🔧 UPDATE NOTES - V1.6

This update focuses on readability, visual hierarchy, panel flow, and chart interpretation.

The core purpose of the script remains unchanged.
This release improves how the existing multi-timeframe trend agreement 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 agreement ribbon presentation.
The ribbon now has a stronger visual hierarchy during locked regimes while keeping the same underlying agreement logic.

• Added a live agreement tag.
The chart now shows a right-edge state and score tag so the current multi-timeframe condition is easier to read at a glance.

• Improved panel flow.
The panel now starts with Workflow, State, Agreement, timeframe rows, Current TF, and a two-line Review row for clearer interpretation.

• Simplified the Agreement panel row.
The Agreement row now shows only the numeric score without a visual meter, creating a cleaner dashboard read.

• Improved chart label language.
Visible chart labels now use readable premium casing and remain inside filled color boxes.

• Added an adjustable live tag offset.
Users can move the right-edge agreement tag farther from the latest bar to avoid overlap.

• Added label clustering control.
Historical regime labels now use a vertical ATR gap filter so repeated state changes do not stack inside the same price area.


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

• Improved chart readability by refining ribbon thickness, fill strength, and label spacing.

• Reduced visual clutter while preserving enough chart story for publication screenshots.

• Refined visual hierarchy so locked, trending, and split states stand out more clearly.

• Adjusted label language and positioning to avoid lowercase slug-style chart text.

• Made Balanced label density more selective so 1H and 4H views stay cleaner.


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

• Optimized panel layout for clearer information flow.

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

• Preserved label font-size control with Normal as the default.

• Added a clearer live agreement tag for current-state reading.


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

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

The EMA regime, market structure, momentum slope, multi-timeframe requests, agreement scoring, conflict state, and lock state remain aligned with the prior version.

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

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


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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, timeframe differences, and symbol behavior may affect how agreement 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.
Versionshinweise
🔧 UPDATE NOTES - v1.7

This update adds a lock-follow-rate proof and improves agreement-label contrast.

The core purpose of the script remains unchanged.
This release keeps the same multi-timeframe voting, agreement states and ribbon, and adds a
historical track record of how often locked regimes kept moving in the dominant direction.

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

- Lock Follow Rate proof layer
The panel now reports how often a locked regime kept following through in the dominant
direction before moving against it, shown with the sample count for transparency.

- Lock Follow Proof Window input
A new setting controls the window used to measure follow-through.

- Per-lock counting
Each regime lock is counted once, so the rate is an honest measure of follow-through on the
selected market and timeframe.

- Clearer agreement labels
Split and mixed agreement labels now use dark text on their lighter badge so they read more
crisply, while bullish and bearish labels keep their established style.

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

- Improved readability of the lighter agreement badges

- Preserved the agreement ribbon, fills and live tag

- Maintained the clean, candle-clear chart layout

- Left the publication-ready visual style intact

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

- Added a Lock Follow Rate row for an at-a-glance follow-through track record

- Added a window setting so the proof measures prompt follow-through

- Kept the existing workflow, state, agreement and timeframe-vote hierarchy

- Enhanced overall user experience without changing the core agreement logic

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

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

The timeframe votes, agreement score and states are unchanged. The Lock Follow Rate is a
separate historical track-record layer and does not alter how agreement is computed.

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

The script remains a rule-based analytical tool.

Market conditions such as volatility, liquidity, and timeframe differences may affect how
agreement, locks and the 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.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.