OPEN-SOURCE SCRIPT
تم تحديثه Relative Strength Pullback Map [AGPro Series]

Relative Strength Pullback Map [AGPro Series]
🧠 Core Idea
Is the pullback happening while the asset remains a relative leader against its benchmark?
📌 Overview / What it does
Relative Strength Pullback Map is a benchmark-relative price-action tool built to study whether an asset is pulling back from strength or breaking down into weakness.
The script compares the active symbol against a selected benchmark, builds a relative-strength baseline, evaluates leader status, measures pullback depth, maps a pullback pocket, marks the recovery rail, and summarizes the full context inside a compact AG Pro panel.
It does not predict future price, automate trades, or claim that every leader pullback must recover. It is a structured decision-support map for reading relative strength, benchmark leadership, pullback health, recovery readiness, and relative breakdown risk.
🎯 Purpose & Design Philosophy
Pullbacks are not all equal.
Some pullbacks happen while the asset continues to outperform its benchmark.
Other pullbacks happen because relative strength is already breaking down.
This script was built to separate those two conditions. The design goal is to help traders identify whether a pullback belongs to a still-strong relative leader or a weakening laggard.
⚡ Why This Script Is Different
Most pullback tools focus only on price.
Most relative-strength tools focus only on the ratio line.
This script does NOT treat pullback quality and relative strength as separate ideas.
Instead, it combines benchmark-relative leadership, price pullback depth, trend shelf behavior, recovery rail reclaim, and relative breakdown risk into one visual map.
The focus is not only whether price pulled back.
The focus is whether the asset remained a leader while pulling back.
⚙️ Methodology
1. Benchmark Comparison
The script compares the active symbol against a selected benchmark using a relative-strength ratio.
2. Relative Strength Baseline
The ratio is smoothed into a baseline so leadership can be evaluated against its own recent behavior.
3. Leader Status Scoring
Leader status combines relative-strength distance, relative-strength slope, and price trend structure.
4. Pullback Depth Measurement
The script measures how far price has pulled back from the recent high using ATR-normalized depth and percentage depth.
5. Pullback Pocket Mapping
The pullback pocket is mapped between the fast recovery rail and the deeper trend shelf.
6. Recovery Evaluation
The script checks whether price is reclaiming the recovery rail while relative strength remains constructive.
7. Visual Output
The chart displays the pullback pocket, recovery rail, relative-strength rail, leader/laggard labels, right-side context tags, alerts, and a compact AG Pro panel.
🗺️ How to Read the Chart
Relative Pullback Pocket = the area where a leader pullback can remain structurally constructive.
Recovery Rail = the fast trend rail used to evaluate whether price is starting to recover from the pullback.
RS LEADER tag = the active symbol is outperforming the selected benchmark with constructive relative strength.
PULLBACK tag = the current pullback depth measured in ATR.
LEADER PULLBACK = the asset remains a relative leader while pulling into a meaningful pullback area.
RS HOLD = relative strength remains constructive during the pullback.
RECOVERY READY = price reclaimed the recovery rail while relative strength remained constructive.
RS BREAK = relative strength weakened or price broke the deeper pullback shelf.
Panel = summarizes relative state, quality score, leader status, pullback depth, recovery trigger, benchmark, and next context.
🚦 Signals & States
• LEADER PULLBACK → the asset remains a relative leader while pulling back.
• RS HOLD → relative strength is still holding during the pullback.
• RECOVERY READY → price reclaimed the recovery rail with constructive relative strength.
• RS BREAK → relative strength weakened or the pullback shelf broke.
• LAGGARD RISK → price is pulling back while the asset is no longer a clear relative leader.
🔔 Alerts Logic
Alerts can trigger when a leader pullback appears, relative strength holds, recovery becomes ready, or relative breakdown appears.
These alerts are attention markers only.
They are not trade instructions, entry signals, exit signals, or guaranteed outcomes.
🧩 Confluence Logic
The context becomes stronger when the active symbol remains above its relative-strength baseline, relative-strength slope is constructive, pullback depth is meaningful but not too deep, and price starts reclaiming the recovery rail.
The context becomes weaker when relative strength drops below its baseline, the slope turns down, or price breaks below the deeper trend shelf.
📊 When to Use
• During trend pullbacks
• When comparing an asset against a benchmark
• In crypto rotation analysis
• In stock or ETF relative-strength review
• When looking for leader pullbacks rather than weak pullbacks
• When filtering pullbacks by benchmark-relative performance
⚠️ When NOT to Use
• On symbols with poor benchmark fit
• During extremely noisy sideways markets
• In low-liquidity markets with unreliable candles
• When benchmark data is missing or unsuitable
• As a standalone buy or sell system
🎛️ Key Inputs
• Benchmark Symbol → defines the market used for relative comparison.
• Relative Strength Baseline → controls the smoothing length of the RS ratio.
• RS Slope Lookback → controls how relative-strength direction is evaluated.
• Minimum Leader Score → controls how strict leader classification should be.
• Fast Trend Length → controls the recovery rail.
• Slow Trend Length → controls the deeper pullback shelf.
• Pullback Lookback → controls the recent high used to measure pullback depth.
• Maximum Healthy Pullback ATR → controls when a pullback becomes too deep.
• Label and Panel Font Size → controls chart readability.
🖥️ Interface & Visual Design
The visual design is built around one question:
Is this still a leader pullback?
The pullback pocket shows the structural area, the recovery rail marks the reclaim reference, the relative-strength rail keeps benchmark context visible, the labels mark state changes, and the AG Pro panel summarizes the current decision context.
🧪 Practical Usage Workflow
1. Select an appropriate benchmark.
2. Read the panel first.
3. Check whether the asset is a relative leader.
4. Review pullback depth.
5. Look at the pullback pocket.
6. Watch whether price reclaims the recovery rail.
7. Confirm the broader market structure independently.
🔍 Interpretation Guidelines
A leader pullback means the asset is pulling back while still holding relative strength.
An RS hold means relative leadership has not broken yet.
Recovery ready means price has started reclaiming the recovery rail while relative strength remains constructive.
An RS break means the pullback may no longer be a clean leader pullback.
None of these states guarantee what happens next.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a financial advice tool.
It is not an automated trading system.
It does not guarantee recovery after a leader pullback.
It does not guarantee that relative leaders will continue outperforming.
It does not replace risk management or independent analysis.
⚠️ Limitations & Transparency
Relative strength depends heavily on benchmark selection.
Different benchmarks may produce different interpretations.
Different timeframes may show different relative-strength states.
Fast markets can move through the pullback pocket quickly.
Sideways markets may create unclear relative-strength readings.
🧠 Market Context Notes
Relative strength is most useful when combined with structure, trend, volatility, and market regime.
A pullback in a relative leader can be constructive if leadership remains intact.
A pullback with relative breakdown is a weaker context and should be interpreted with caution.
Benchmark choice matters: crypto pairs may use BTCUSDT, stock charts may use SPY, sector ETFs, or another relevant benchmark.
🧾 Use Case Examples
When ETH pulls back while still outperforming BTC, the script can identify whether the pullback remains constructive or starts losing relative strength.
When a stock pulls back against SPY but relative strength holds above baseline, the script can highlight a leader pullback context.
When price breaks the pullback shelf while RS weakens, the script can flag relative breakdown risk.
🧱 System Philosophy
Relative Strength Pullback Map is part of the AGPro Series approach:
Build visual tools that explain market context clearly, avoid hype, avoid prediction claims, and support structured decision-making.
The goal is not to tell users what to do.
The goal is to help users see whether a pullback belongs to a strong leader or a weakening asset.
🔐 Non-Promise Statement
No script can remove uncertainty from trading.
This tool does not promise accuracy, certainty, profitability, or future performance.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly.
Users are responsible for their own decisions, position sizing, risk management, benchmark selection, and interpretation.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use this script as a structured way to study relative strength, benchmark leadership, pullback depth, and recovery context.
The most valuable output is not a single label.
The value is the full map: relative state, leader status, pullback pocket, recovery rail, and next context.
🧠 Core Idea
Is the pullback happening while the asset remains a relative leader against its benchmark?
📌 Overview / What it does
Relative Strength Pullback Map is a benchmark-relative price-action tool built to study whether an asset is pulling back from strength or breaking down into weakness.
The script compares the active symbol against a selected benchmark, builds a relative-strength baseline, evaluates leader status, measures pullback depth, maps a pullback pocket, marks the recovery rail, and summarizes the full context inside a compact AG Pro panel.
It does not predict future price, automate trades, or claim that every leader pullback must recover. It is a structured decision-support map for reading relative strength, benchmark leadership, pullback health, recovery readiness, and relative breakdown risk.
🎯 Purpose & Design Philosophy
Pullbacks are not all equal.
Some pullbacks happen while the asset continues to outperform its benchmark.
Other pullbacks happen because relative strength is already breaking down.
This script was built to separate those two conditions. The design goal is to help traders identify whether a pullback belongs to a still-strong relative leader or a weakening laggard.
⚡ Why This Script Is Different
Most pullback tools focus only on price.
Most relative-strength tools focus only on the ratio line.
This script does NOT treat pullback quality and relative strength as separate ideas.
Instead, it combines benchmark-relative leadership, price pullback depth, trend shelf behavior, recovery rail reclaim, and relative breakdown risk into one visual map.
The focus is not only whether price pulled back.
The focus is whether the asset remained a leader while pulling back.
⚙️ Methodology
1. Benchmark Comparison
The script compares the active symbol against a selected benchmark using a relative-strength ratio.
2. Relative Strength Baseline
The ratio is smoothed into a baseline so leadership can be evaluated against its own recent behavior.
3. Leader Status Scoring
Leader status combines relative-strength distance, relative-strength slope, and price trend structure.
4. Pullback Depth Measurement
The script measures how far price has pulled back from the recent high using ATR-normalized depth and percentage depth.
5. Pullback Pocket Mapping
The pullback pocket is mapped between the fast recovery rail and the deeper trend shelf.
6. Recovery Evaluation
The script checks whether price is reclaiming the recovery rail while relative strength remains constructive.
7. Visual Output
The chart displays the pullback pocket, recovery rail, relative-strength rail, leader/laggard labels, right-side context tags, alerts, and a compact AG Pro panel.
🗺️ How to Read the Chart
Relative Pullback Pocket = the area where a leader pullback can remain structurally constructive.
Recovery Rail = the fast trend rail used to evaluate whether price is starting to recover from the pullback.
RS LEADER tag = the active symbol is outperforming the selected benchmark with constructive relative strength.
PULLBACK tag = the current pullback depth measured in ATR.
LEADER PULLBACK = the asset remains a relative leader while pulling into a meaningful pullback area.
RS HOLD = relative strength remains constructive during the pullback.
RECOVERY READY = price reclaimed the recovery rail while relative strength remained constructive.
RS BREAK = relative strength weakened or price broke the deeper pullback shelf.
Panel = summarizes relative state, quality score, leader status, pullback depth, recovery trigger, benchmark, and next context.
🚦 Signals & States
• LEADER PULLBACK → the asset remains a relative leader while pulling back.
• RS HOLD → relative strength is still holding during the pullback.
• RECOVERY READY → price reclaimed the recovery rail with constructive relative strength.
• RS BREAK → relative strength weakened or the pullback shelf broke.
• LAGGARD RISK → price is pulling back while the asset is no longer a clear relative leader.
🔔 Alerts Logic
Alerts can trigger when a leader pullback appears, relative strength holds, recovery becomes ready, or relative breakdown appears.
These alerts are attention markers only.
They are not trade instructions, entry signals, exit signals, or guaranteed outcomes.
🧩 Confluence Logic
The context becomes stronger when the active symbol remains above its relative-strength baseline, relative-strength slope is constructive, pullback depth is meaningful but not too deep, and price starts reclaiming the recovery rail.
The context becomes weaker when relative strength drops below its baseline, the slope turns down, or price breaks below the deeper trend shelf.
📊 When to Use
• During trend pullbacks
• When comparing an asset against a benchmark
• In crypto rotation analysis
• In stock or ETF relative-strength review
• When looking for leader pullbacks rather than weak pullbacks
• When filtering pullbacks by benchmark-relative performance
⚠️ When NOT to Use
• On symbols with poor benchmark fit
• During extremely noisy sideways markets
• In low-liquidity markets with unreliable candles
• When benchmark data is missing or unsuitable
• As a standalone buy or sell system
🎛️ Key Inputs
• Benchmark Symbol → defines the market used for relative comparison.
• Relative Strength Baseline → controls the smoothing length of the RS ratio.
• RS Slope Lookback → controls how relative-strength direction is evaluated.
• Minimum Leader Score → controls how strict leader classification should be.
• Fast Trend Length → controls the recovery rail.
• Slow Trend Length → controls the deeper pullback shelf.
• Pullback Lookback → controls the recent high used to measure pullback depth.
• Maximum Healthy Pullback ATR → controls when a pullback becomes too deep.
• Label and Panel Font Size → controls chart readability.
🖥️ Interface & Visual Design
The visual design is built around one question:
Is this still a leader pullback?
The pullback pocket shows the structural area, the recovery rail marks the reclaim reference, the relative-strength rail keeps benchmark context visible, the labels mark state changes, and the AG Pro panel summarizes the current decision context.
🧪 Practical Usage Workflow
1. Select an appropriate benchmark.
2. Read the panel first.
3. Check whether the asset is a relative leader.
4. Review pullback depth.
5. Look at the pullback pocket.
6. Watch whether price reclaims the recovery rail.
7. Confirm the broader market structure independently.
🔍 Interpretation Guidelines
A leader pullback means the asset is pulling back while still holding relative strength.
An RS hold means relative leadership has not broken yet.
Recovery ready means price has started reclaiming the recovery rail while relative strength remains constructive.
An RS break means the pullback may no longer be a clean leader pullback.
None of these states guarantee what happens next.
🚫 What This Script Is NOT
This script is not a prediction engine.
It is not a financial advice tool.
It is not an automated trading system.
It does not guarantee recovery after a leader pullback.
It does not guarantee that relative leaders will continue outperforming.
It does not replace risk management or independent analysis.
⚠️ Limitations & Transparency
Relative strength depends heavily on benchmark selection.
Different benchmarks may produce different interpretations.
Different timeframes may show different relative-strength states.
Fast markets can move through the pullback pocket quickly.
Sideways markets may create unclear relative-strength readings.
🧠 Market Context Notes
Relative strength is most useful when combined with structure, trend, volatility, and market regime.
A pullback in a relative leader can be constructive if leadership remains intact.
A pullback with relative breakdown is a weaker context and should be interpreted with caution.
Benchmark choice matters: crypto pairs may use BTCUSDT, stock charts may use SPY, sector ETFs, or another relevant benchmark.
🧾 Use Case Examples
When ETH pulls back while still outperforming BTC, the script can identify whether the pullback remains constructive or starts losing relative strength.
When a stock pulls back against SPY but relative strength holds above baseline, the script can highlight a leader pullback context.
When price breaks the pullback shelf while RS weakens, the script can flag relative breakdown risk.
🧱 System Philosophy
Relative Strength Pullback Map is part of the AGPro Series approach:
Build visual tools that explain market context clearly, avoid hype, avoid prediction claims, and support structured decision-making.
The goal is not to tell users what to do.
The goal is to help users see whether a pullback belongs to a strong leader or a weakening asset.
🔐 Non-Promise Statement
No script can remove uncertainty from trading.
This tool does not promise accuracy, certainty, profitability, or future performance.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly.
Users are responsible for their own decisions, position sizing, risk management, benchmark selection, and interpretation.
This script is for educational and analytical purposes only and does not provide financial advice.
📚 Educational Note
Use this script as a structured way to study relative strength, benchmark leadership, pullback depth, and recovery context.
The most valuable output is not a single label.
The value is the full map: relative state, leader status, pullback pocket, recovery rail, and next context.
ملاحظات الأخبار
🔧 UPDATE NOTES - V1.1This update focuses on light publication polish, positioning control, and interface flexibility.
The core purpose of the script remains unchanged.
This release keeps the existing relative-strength pullback logic intact and only refines small presentation controls.
This script continues to function as an analytical and visualization tool.
It does not attempt to predict price direction or provide guaranteed outcomes.
------------------------
What Changed
------------------------
• Added Pocket Badge Anchor
The centered pullback-pocket badge can now be shifted inside the projected pocket without changing the underlying model.
• Added Right Tag Detail mode
Compact mode keeps the chart cleaner, while Full mode adds additional score and benchmark detail to the right-side tags.
• Added Light panel theme support
The panel now supports Dark, Slate, and Light themes while preserving the AG Pro blue merged header row.
• Expanded panel location controls
Panel placement now includes top, middle, and bottom center positions for easier screenshot composition.
• Added Huge font-size option
Label and panel font-size controls now include a larger display option for publication or high-resolution chart views.
------------------------
Visual Improvements
------------------------
• Preserved the pullback pocket, recovery rail, relative-strength rail, right-side tags, and event labels
• Improved control over centered pocket badge placement
• Added compact/full right-tag behavior for cleaner chart composition
• Kept the visual identity close to the original release
------------------------
Interface & Usability
------------------------
• Preserved the single merged blue AG Pro panel header row
• Added Light theme support alongside Dark and Slate
• Added center placement options for the panel
• Kept panel visibility, panel font-size, and label font-size controls available from settings
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The goal is to keep the published visual identity intact while adding practical controls for cleaner presentation.
Users should interpret outputs the same way as before.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Benchmark selection, timeframe changes, volatility, and market regime differences may affect how relative-strength pullback 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.
ملاحظات الأخبار
🔧 UPDATE NOTES - v1.3This update sharpens the Relative Strength Pullback Map into a decision-ready
planner. The existing relative-strength engine is unchanged; this release adds the
missing decision layer - an explicit recovery target, a pullback-failure
invalidation level, and a stop-aware recovery follow-through proof rate - and
improves on-chart legibility.
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
------------------------
• Recovery Target row
The panel now shows an explicit recovery objective - the recent high the price
pulled back from - so the upside reference of a leader pullback is visible at a
glance.
• Invalidation row
The buffered pullback-failure shelf (the lower edge of the pullback pocket) is now
surfaced as an explicit invalidation price, making the risk side of the setup
clear.
• Stop-aware Proof rate
A new Proof statistic validates the script's core thesis. When a leader-pullback
setup forms, the script measures whether price retraces half of the pullback - a
genuine recovery leg - before the pullback-failure level is hit. It is confirmed-
bar gated, unresolved setups time out uncounted, and the panel shows "Building (n)"
until at least six completed samples accumulate.
• Action row
The former "Next Context" line is now an Action read, stated in plain language and
colored by relative state.
• Quality Score readout
The Quality Score now reads as "score / 100" and is tier-colored for faster
interpretation.
------------------------
Visual Improvements
------------------------
• Improved chart readability with a luminance-aware text-contrast routine applied
to every on-chart element - event labels, the centered pocket badge, and the
right-side tags - so text stays legible on bright and dark fills alike.
• Refined the panel hierarchy so the decision layer (Target, Invalidation, Action,
Proof) sits alongside the existing relative-strength context.
• Tightened event-label text for cleaner spacing on compressed and higher
timeframes, and kept event-label density moderate and the pullback pocket anchored by a single
centered badge, preserving a clean premium first-glance read.
------------------------
Interface & Usability
------------------------
• Optimized panel layout for clearer information flow, grouping context, the
decision layer, and the proof evidence.
• Retained the independent label and panel font-size settings.
• Enhanced overall user experience without changing the core relative-strength
logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
The relative-strength engine, pullback detection, and state classification behave
as before. The target, invalidation, action read, and proof are presentation and
evaluation layers built on top of the existing outputs.
Users should interpret outputs the same way as before, now with a clearer risk and
recovery read and an honest, stop-aware proof statistic.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Relative strength, pullback depth, and recovery behavior vary with the chosen
benchmark, timeframe, volatility, and liquidity. The Proof rate is a descriptive
statistic of past setups on the current symbol and timeframe; it is not a forward-
looking expectation.
Outputs should always be interpreted within broader market context.
------------------------
Risk Reminder
------------------------
This script is for educational and analytical purposes only.
It does not provide financial advice or guaranteed trading outcomes.
Users remain responsible for their own decisions.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Public-free scripts + invite-only AGPro workflows for market analysis, liquidity context, risk planning and execution review.
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
Rules-based. No hype. No guesswork.
Library & access: agprolabs.com/
Telegram: t.me/agprolabs
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.