OPEN-SOURCE SCRIPT
تم تحديثه Trend Exhaustion Snapback Planner [AGPro Series]

Trend Exhaustion Snapback Planner [AGPro Series]
🧠 Core Idea
Is the current trend stretch becoming snapback-ready, or is momentum still supported enough to avoid calling exhaustion too early?
📌 Overview / What it does
Trend Exhaustion Snapback Planner [AGPro Series] is a rule-based trend exhaustion and mean-reversion planning tool. It measures how far price has stretched away from its trend mean, then evaluates whether that stretch is supported by pressure, efficiency loss, wick behavior, and room back toward value.
The script produces an exhaustion pocket, snapback rail, failure rail, room reference, event labels, right-side tags, optional bar coloring, and a compact AG Pro dashboard with a 0-100 Snapback Score.
It does not predict reversals. It helps organize trend stretch, exhaustion quality, snapback reclaim behavior, failure risk, and next-action state.
🎯 Purpose & Design Philosophy
Strong trends can stay stretched for longer than expected. At the same time, many reversals begin only after a trend becomes inefficient and price starts moving back toward value.
This script was built to help traders review that transition without relying on a simple overbought or oversold reading.
It supports a patient workflow: identify stretch, wait for reclaim behavior, evaluate room, then interpret the active state within broader market context.
⚡ Why This Script Is Different
Most exhaustion tools focus on RSI extremes, distance from a moving average, or isolated reversal candles.
This script does NOT treat every stretched move as a reversal.
Instead, it maps a live exhaustion pocket, scores stretch quality, tracks snapback reclaim behavior, defines where the idea fails, and shows whether there is room back toward the trend mean.
⚙️ Methodology
1. Trend Stretch Detection
The script measures price distance from a trend mean using ATR normalization.
2. Pressure Evaluation
RSI pressure, wick behavior, and trend-efficiency loss are reviewed to decide whether the extension is weakening.
3. Snapback Rail Mapping
Once a valid exhaustion pocket appears, the snapback rail becomes the first reclaim threshold.
4. Risk / Room Structure
The failure rail marks continuation risk, while the room rail shows the value or structure reference that price may test after reclaim.
5. Visual Output
The chart receives the exhaustion pocket, trend mean, snapback rail, failure rail, room rail, event labels, right-side tags, optional bar coloring, and dashboard panel.
🗺️ How to Read the Chart
The exhaustion pocket marks the stretch area created after price moves far away from its trend mean.
The snapback rail shows the reclaim level that improves the snapback context.
The failure rail marks where continuation risk invalidates the active snapback idea.
The room rail shows the next value or structure reference after the snapback begins.
Labels highlight stretch pockets, snapback reclaim, pocket pressure, room tests, and failed snapbacks.
Colors represent context:
• Teal → bullish snapback context
• Pink → bearish snapback context or failure
• Gold → room, waiting, or neutral review
• Indigo → pocket pressure or monitoring context
The panel summarizes:
• Pocket
• Snapback Score
• Stretch
• Room
• Action
🚦 Signals & States
• Bull Snapback Pocket → downside trend stretch with bullish snapback context
• Bear Snapback Pocket → upside trend stretch with bearish snapback context
• Snapback Reclaim → price reclaimed the active snapback rail
• Pocket Pressure → price is testing the exhaustion pocket without clean reclaim
• Room Test → price reached the active room reference
• Failed → price crossed the failure rail
• READY → reclaim and score quality are strong enough to monitor
• MONITOR → snapback context is active but not fully ready
• WAIT RECLAIM → pocket exists but reclaim has not confirmed
• EXPIRED → the pocket is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a bullish or bearish snapback pocket appears, when price reclaims the snapback rail, when the READY state appears, when pocket pressure appears, when the room rail is reached, or when the context fails.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when ATR stretch, RSI pressure, wick behavior, efficiency loss, snapback reclaim, and room back toward value align.
No single condition is treated as enough by itself.
📊 When to Use
• Mature directional moves
• Strong extensions away from trend mean
• Markets with visible impulse and reaction structure
• 1H, 4H, and 1D review where exhaustion context matters
• Crypto, indices, forex, and liquid stocks
⚠️ When NOT to Use
• Extremely illiquid symbols
• Very low-volume periods
• News shock candles with abnormal gaps
• Very tight ranges with no meaningful trend stretch
• Markets where spreads or wicks dominate the structure
🎛️ Key Inputs
• ATR Length → normalizes trend stretch and rail distances
• Trend Mean Length → controls the main value reference
• Minimum Stretch ATR → controls how stretched price must be before a pocket appears
• RSI Pressure → controls pressure thresholds for extended conditions
• Efficiency Length → controls how trend efficiency loss is measured
• Minimum Ready Score → controls how strict READY classification is
• Projection Bars → controls how far rails and zones extend
• Visual settings → control labels, tags, panel location, theme, and font size
🖥️ Interface & Visual Design
The panel is designed as a compact decision dashboard, not a large data table.
The first row uses a merged AG Pro header. The remaining rows show the pocket state, score, stretch context, room, and action.
The visual hierarchy is built so traders can read the active plan quickly without losing chart structure.
🧪 Practical Usage Workflow
1. Read the panel.
2. Check whether an exhaustion pocket is active.
3. Watch the snapback rail for reclaim behavior.
4. Review failure risk and room back toward value.
5. Interpret labels as context markers, not trade commands.
🔍 Interpretation Guidelines
A high score means the active stretch has multiple snapback conditions aligned.
A snapback reclaim improves the context, but it does not guarantee continuation toward the room rail.
A failed state means price crossed the continuation-risk boundary for that active pocket.
Use the script to organize the question, not to outsource the answer.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an automated trading system.
It does not place orders.
It does not guarantee reversal timing, target reach, or profitability.
⚠️ Limitations & Transparency
Trend exhaustion can remain extended for long periods.
Different timeframes may show different exhaustion and snapback contexts.
Volatility spikes can distort ATR-normalized distance.
Low liquidity can create false stretch pockets or unreliable wick behavior.
The script is rule-based and should be interpreted within broader market context.
🧠 Market Context Notes
Trend exhaustion is not the same as trend reversal.
The most useful snapback contexts often appear when price stretches away from value, momentum efficiency weakens, and reclaim behavior begins before the failure rail breaks.
The strongest readings usually come from alignment between structure, volatility, and reaction quality.
🧾 Use Case Examples
When price stretches far above the trend mean, RSI pressure rises, and the candle begins reclaiming back through the snapback rail, the bearish snapback context may become more meaningful.
When price stretches below the trend mean but cannot reclaim the snapback rail, the script may remain in WAIT RECLAIM or PRESSURE instead of READY.
When price reaches the room rail after reclaim, the context shifts into room review rather than fresh entry signaling.
🧱 System Philosophy
AGPro Series tools are built as decision-support systems.
They aim to convert market structure into readable context: what is active, what improves the plan, what invalidates it, and what should be reviewed next.
🔐 Non-Promise Statement
No script can provide certainty.
No signal guarantees outcome.
This tool provides structured context only.
📉 Risk Disclosure
Trading involves risk.
Markets can move quickly and unexpectedly.
Users are responsible for their own analysis, risk management, and decisions.
This script does not provide financial advice.
📚 Educational Note
Use this tool to study how trend stretch, momentum pressure, efficiency loss, and snapback behavior interact across different markets and timeframes.
🧠 Core Idea
Is the current trend stretch becoming snapback-ready, or is momentum still supported enough to avoid calling exhaustion too early?
📌 Overview / What it does
Trend Exhaustion Snapback Planner [AGPro Series] is a rule-based trend exhaustion and mean-reversion planning tool. It measures how far price has stretched away from its trend mean, then evaluates whether that stretch is supported by pressure, efficiency loss, wick behavior, and room back toward value.
The script produces an exhaustion pocket, snapback rail, failure rail, room reference, event labels, right-side tags, optional bar coloring, and a compact AG Pro dashboard with a 0-100 Snapback Score.
It does not predict reversals. It helps organize trend stretch, exhaustion quality, snapback reclaim behavior, failure risk, and next-action state.
🎯 Purpose & Design Philosophy
Strong trends can stay stretched for longer than expected. At the same time, many reversals begin only after a trend becomes inefficient and price starts moving back toward value.
This script was built to help traders review that transition without relying on a simple overbought or oversold reading.
It supports a patient workflow: identify stretch, wait for reclaim behavior, evaluate room, then interpret the active state within broader market context.
⚡ Why This Script Is Different
Most exhaustion tools focus on RSI extremes, distance from a moving average, or isolated reversal candles.
This script does NOT treat every stretched move as a reversal.
Instead, it maps a live exhaustion pocket, scores stretch quality, tracks snapback reclaim behavior, defines where the idea fails, and shows whether there is room back toward the trend mean.
⚙️ Methodology
1. Trend Stretch Detection
The script measures price distance from a trend mean using ATR normalization.
2. Pressure Evaluation
RSI pressure, wick behavior, and trend-efficiency loss are reviewed to decide whether the extension is weakening.
3. Snapback Rail Mapping
Once a valid exhaustion pocket appears, the snapback rail becomes the first reclaim threshold.
4. Risk / Room Structure
The failure rail marks continuation risk, while the room rail shows the value or structure reference that price may test after reclaim.
5. Visual Output
The chart receives the exhaustion pocket, trend mean, snapback rail, failure rail, room rail, event labels, right-side tags, optional bar coloring, and dashboard panel.
🗺️ How to Read the Chart
The exhaustion pocket marks the stretch area created after price moves far away from its trend mean.
The snapback rail shows the reclaim level that improves the snapback context.
The failure rail marks where continuation risk invalidates the active snapback idea.
The room rail shows the next value or structure reference after the snapback begins.
Labels highlight stretch pockets, snapback reclaim, pocket pressure, room tests, and failed snapbacks.
Colors represent context:
• Teal → bullish snapback context
• Pink → bearish snapback context or failure
• Gold → room, waiting, or neutral review
• Indigo → pocket pressure or monitoring context
The panel summarizes:
• Snapback Score
• Stretch
• Room
• Action
🚦 Signals & States
• Bull Snapback Pocket → downside trend stretch with bullish snapback context
• Bear Snapback Pocket → upside trend stretch with bearish snapback context
• Snapback Reclaim → price reclaimed the active snapback rail
• Pocket Pressure → price is testing the exhaustion pocket without clean reclaim
• Room Test → price reached the active room reference
• Failed → price crossed the failure rail
• READY → reclaim and score quality are strong enough to monitor
• MONITOR → snapback context is active but not fully ready
• WAIT RECLAIM → pocket exists but reclaim has not confirmed
• EXPIRED → the pocket is too old to remain active
🔔 Alerts Logic
Alerts can trigger when a bullish or bearish snapback pocket appears, when price reclaims the snapback rail, when the READY state appears, when pocket pressure appears, when the room rail is reached, or when the context fails.
Alerts are attention markers only. They are not trade instructions.
🧩 Confluence Logic
The context becomes stronger when ATR stretch, RSI pressure, wick behavior, efficiency loss, snapback reclaim, and room back toward value align.
No single condition is treated as enough by itself.
📊 When to Use
• Mature directional moves
• Strong extensions away from trend mean
• Markets with visible impulse and reaction structure
• 1H, 4H, and 1D review where exhaustion context matters
• Crypto, indices, forex, and liquid stocks
⚠️ When NOT to Use
• Extremely illiquid symbols
• Very low-volume periods
• News shock candles with abnormal gaps
• Very tight ranges with no meaningful trend stretch
• Markets where spreads or wicks dominate the structure
🎛️ Key Inputs
• ATR Length → normalizes trend stretch and rail distances
• Trend Mean Length → controls the main value reference
• Minimum Stretch ATR → controls how stretched price must be before a pocket appears
• RSI Pressure → controls pressure thresholds for extended conditions
• Efficiency Length → controls how trend efficiency loss is measured
• Minimum Ready Score → controls how strict READY classification is
• Projection Bars → controls how far rails and zones extend
• Visual settings → control labels, tags, panel location, theme, and font size
🖥️ Interface & Visual Design
The panel is designed as a compact decision dashboard, not a large data table.
The first row uses a merged AG Pro header. The remaining rows show the pocket state, score, stretch context, room, and action.
The visual hierarchy is built so traders can read the active plan quickly without losing chart structure.
🧪 Practical Usage Workflow
1. Read the panel.
2. Check whether an exhaustion pocket is active.
3. Watch the snapback rail for reclaim behavior.
4. Review failure risk and room back toward value.
5. Interpret labels as context markers, not trade commands.
🔍 Interpretation Guidelines
A high score means the active stretch has multiple snapback conditions aligned.
A snapback reclaim improves the context, but it does not guarantee continuation toward the room rail.
A failed state means price crossed the continuation-risk boundary for that active pocket.
Use the script to organize the question, not to outsource the answer.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not financial advice.
It is not an automated trading system.
It does not place orders.
It does not guarantee reversal timing, target reach, or profitability.
⚠️ Limitations & Transparency
Trend exhaustion can remain extended for long periods.
Different timeframes may show different exhaustion and snapback contexts.
Volatility spikes can distort ATR-normalized distance.
Low liquidity can create false stretch pockets or unreliable wick behavior.
The script is rule-based and should be interpreted within broader market context.
🧠 Market Context Notes
Trend exhaustion is not the same as trend reversal.
The most useful snapback contexts often appear when price stretches away from value, momentum efficiency weakens, and reclaim behavior begins before the failure rail breaks.
The strongest readings usually come from alignment between structure, volatility, and reaction quality.
🧾 Use Case Examples
When price stretches far above the trend mean, RSI pressure rises, and the candle begins reclaiming back through the snapback rail, the bearish snapback context may become more meaningful.
When price stretches below the trend mean but cannot reclaim the snapback rail, the script may remain in WAIT RECLAIM or PRESSURE instead of READY.
When price reaches the room rail after reclaim, the context shifts into room review rather than fresh entry signaling.
🧱 System Philosophy
AGPro Series tools are built as decision-support systems.
They aim to convert market structure into readable context: what is active, what improves the plan, what invalidates it, and what should be reviewed next.
🔐 Non-Promise Statement
No script can provide certainty.
No signal guarantees outcome.
This tool provides structured context only.
📉 Risk Disclosure
Trading involves risk.
Markets can move quickly and unexpectedly.
Users are responsible for their own analysis, risk management, and decisions.
This script does not provide financial advice.
📚 Educational Note
Use this tool to study how trend stretch, momentum pressure, efficiency loss, and snapback behavior interact across different markets and timeframes.
ملاحظات الأخبار
UPDATE NOTES - V1.1This update focuses on source cleanup, centered pocket ownership, panel standardization, and publication readiness.
The core purpose of the script remains unchanged.
This release improves how exhaustion pockets, snapback rails, failure rails, room references, event labels, and the panel 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
------------------------
* Fixed the version header.
The source header now uses the correct Version field.
* Replaced box text with a separate centered pocket badge.
The exhaustion pocket no longer uses box text or box text update calls. Pocket ownership is now handled by a separate centered label object.
* Preserved the core Trend Exhaustion Snapback engine.
Trend mean, stretch detection, RSI pressure, efficiency loss, snapback rail, failure rail, room rail, scoring, state logic, event labels, right-side tags, and alerts remain intact.
* Standardized panel controls.
Panel show/hide, panel location, panel theme, and panel font-size controls now follow the current AGPro format.
* Expanded font-size controls.
Label and panel font controls now include Tiny, Small, Normal, Large, and Huge.
------------------------
Visual Improvements
------------------------
* Exhaustion pockets now read as owned zones through a centered badge.
* The pocket badge remains vertically and horizontally centered without using box text APIs.
* Panel layout follows the standard single merged blue header format.
* Right-side tags and event labels remain available while the pocket zone becomes easier to read at first glance.
------------------------
Interface & Usability
------------------------
* Added Elite Dark, Slate, and Clean Light panel themes.
* Expanded panel locations to include top, middle, and bottom center positions.
* Added live panel repositioning with table.set_position.
* Panel header now follows the AGPro render order: table.clear -> table.merge_cells -> header.
* Show Panel now deletes the panel cleanly when disabled.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
Outputs should still be read as exhaustion context, snapback planning, failure risk, and room-back-to-value mapping.
The goal is to improve clarity and usability, not to introduce predictive behavior.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, trend strength, timeframe differences, RSI pressure, and efficiency behavior may affect how pockets and snapback 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.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
⚡ Precision Pine tools for crypto & FX traders
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
⚡ Precision Pine tools for crypto & FX traders
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
📊 ICT • Smart Money • Market Structure • Liquidity
🧠 Rules-based decision tools. No hype. No guesswork
⭐ Public AGPro Series + advanced invite-only tools
💬 t.me/agprolabs
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.