OPEN-SOURCE SCRIPT
Updated Level Survival Map [AGPro Series]

Level Survival Map [AGPro Series]
🔹 Overview
Level Survival Map is a premium support and resistance framework that does not just draw lines on the chart. Every detected level carries a live Survival Score between 0 and 100 that answers one simple question: how well is this level still defending itself right now. The map highlights a single Active Level with an interaction zone and a forward projection ribbon, while nearby weaker levels fade, so traders always know which level actually matters for the current decision.
🔸 Unique Edge
Most support and resistance tools either show static pivots or basic break or retest events. Level Survival Map goes further by measuring the quality of every interaction and turning it into a single composite health score per level. Instead of being left with a wall of equally important lines, the trader sees a ranked structural battlefield with one clearly identified Active Level, a visible interaction zone and a projection ribbon for planning. The Damage State readout, the Fresh and Eroded state semantics, the automatic flip from broken support to new resistance and the cluster fade for crowded weaker levels are designed to work together as one premium, low-noise workflow.
🔹 Methodology
Pivot detection builds the raw candidate levels from swing highs and swing lows using the standard pivot window. A merge filter removes duplicates that sit within a configurable ATR distance of an existing same-type level. Each active level then accumulates four independent components over time. Close Respect rewards closes that respect the level side, for example closes above a support. Penetration Damage penalises wicks and bodies that pierce through the level zone. Reaction Quality rewards strong rejection wicks and bodies moving away from the level after a test. Test Fatigue penalises repeated tests because levels tend to weaken with each new hit. These four components are weighted and combined into a single Survival Score, then clamped between 0 and 100. A structural break caps the score at 35, heavy damage across multiple tests caps it at 28, and a confirmed sequence of opposite-side closes flips the level type while resetting its history. The Active Level is chosen as the closest same-side level to price so that the focus always follows the real decision point.
🔸 Signals and Alerts
The visual output itself is the primary signal. Line colour and thickness communicate level strength at a glance. A focused Active Level is drawn with an interaction zone, a darker core band and a forward projection ribbon so that traders can see the exact price band where reaction is most likely, and how far into the future that band is expected to remain relevant. Labels carry the Survival Score directly, so the ranking of levels is always visible without opening any settings. Broken levels switch to a dashed style and faded colour, and once enough opposite-side closes accumulate they flip type automatically, giving a clear visual signature of structural change.
🔹 Key Inputs
Pivot Left Bars and Pivot Right Bars control how strict the swing detection is. Max Active Levels caps how many concurrent levels are tracked. Level Merge Distance and Interaction Zone are expressed in ATR units so the logic adapts across timeframes and instruments. Scoring weights for Close Respect, Penetration Damage, Reaction Quality and Test Fatigue can be tuned independently, together with the fatigue penalty per extra test and the number of closes required to confirm a flip. Visual inputs cover panel position, label size, line width, focus emphasis, non-focus transparency, cluster fade, focus zone width and projection ribbon length and thickness. A Clean Map Mode is provided for screenshot and publishing workflows where only the Active Level and the nearest valid support and resistance are labelled.
🔸 How to Use
Read the map top down. First, look at the summary panel for the Active Level, its Survival Score, Test Count and Damage State. A Fresh or Strong Active Level defending its side is a high-quality decision point. A Fragile or Eroded Active Level with a Severe Damage State is a warning that the next level below or above is likely to take over. Use the projection ribbon as a planning band for reaction rather than a mechanical entry. Use the ranked non-Active labels to understand where price is likely to travel if the Active Level gives way. The tool is designed to be used as a visual framework, in combination with the trader own execution method, trend context and risk management.
🔹 Limitations and Transparency
This indicator is a visual analytical framework, not a strategy, not a signal service and not financial advice. Survival Score, Damage State and flip logic are deterministic functions of price action and ATR, so different markets and timeframes will produce different characteristic score ranges. Pivot based detection is inherently lagging by the Pivot Right Bars window, which is the expected behaviour of any structural tool and not a defect. The Active Level projection ribbon is a visual planning aid, not a forecast. Past level behaviour does not guarantee future behaviour.
🔸 Risk Disclosure
Trading involves substantial risk and is not suitable for every investor. This script is published for educational and analytical purposes only. Users are solely responsible for their own trading decisions, position sizing and risk management. Always test any tool on your own instruments and timeframes before using it in a live environment.
🔹 Overview
Level Survival Map is a premium support and resistance framework that does not just draw lines on the chart. Every detected level carries a live Survival Score between 0 and 100 that answers one simple question: how well is this level still defending itself right now. The map highlights a single Active Level with an interaction zone and a forward projection ribbon, while nearby weaker levels fade, so traders always know which level actually matters for the current decision.
🔸 Unique Edge
Most support and resistance tools either show static pivots or basic break or retest events. Level Survival Map goes further by measuring the quality of every interaction and turning it into a single composite health score per level. Instead of being left with a wall of equally important lines, the trader sees a ranked structural battlefield with one clearly identified Active Level, a visible interaction zone and a projection ribbon for planning. The Damage State readout, the Fresh and Eroded state semantics, the automatic flip from broken support to new resistance and the cluster fade for crowded weaker levels are designed to work together as one premium, low-noise workflow.
🔹 Methodology
Pivot detection builds the raw candidate levels from swing highs and swing lows using the standard pivot window. A merge filter removes duplicates that sit within a configurable ATR distance of an existing same-type level. Each active level then accumulates four independent components over time. Close Respect rewards closes that respect the level side, for example closes above a support. Penetration Damage penalises wicks and bodies that pierce through the level zone. Reaction Quality rewards strong rejection wicks and bodies moving away from the level after a test. Test Fatigue penalises repeated tests because levels tend to weaken with each new hit. These four components are weighted and combined into a single Survival Score, then clamped between 0 and 100. A structural break caps the score at 35, heavy damage across multiple tests caps it at 28, and a confirmed sequence of opposite-side closes flips the level type while resetting its history. The Active Level is chosen as the closest same-side level to price so that the focus always follows the real decision point.
🔸 Signals and Alerts
The visual output itself is the primary signal. Line colour and thickness communicate level strength at a glance. A focused Active Level is drawn with an interaction zone, a darker core band and a forward projection ribbon so that traders can see the exact price band where reaction is most likely, and how far into the future that band is expected to remain relevant. Labels carry the Survival Score directly, so the ranking of levels is always visible without opening any settings. Broken levels switch to a dashed style and faded colour, and once enough opposite-side closes accumulate they flip type automatically, giving a clear visual signature of structural change.
🔹 Key Inputs
Pivot Left Bars and Pivot Right Bars control how strict the swing detection is. Max Active Levels caps how many concurrent levels are tracked. Level Merge Distance and Interaction Zone are expressed in ATR units so the logic adapts across timeframes and instruments. Scoring weights for Close Respect, Penetration Damage, Reaction Quality and Test Fatigue can be tuned independently, together with the fatigue penalty per extra test and the number of closes required to confirm a flip. Visual inputs cover panel position, label size, line width, focus emphasis, non-focus transparency, cluster fade, focus zone width and projection ribbon length and thickness. A Clean Map Mode is provided for screenshot and publishing workflows where only the Active Level and the nearest valid support and resistance are labelled.
🔸 How to Use
Read the map top down. First, look at the summary panel for the Active Level, its Survival Score, Test Count and Damage State. A Fresh or Strong Active Level defending its side is a high-quality decision point. A Fragile or Eroded Active Level with a Severe Damage State is a warning that the next level below or above is likely to take over. Use the projection ribbon as a planning band for reaction rather than a mechanical entry. Use the ranked non-Active labels to understand where price is likely to travel if the Active Level gives way. The tool is designed to be used as a visual framework, in combination with the trader own execution method, trend context and risk management.
🔹 Limitations and Transparency
This indicator is a visual analytical framework, not a strategy, not a signal service and not financial advice. Survival Score, Damage State and flip logic are deterministic functions of price action and ATR, so different markets and timeframes will produce different characteristic score ranges. Pivot based detection is inherently lagging by the Pivot Right Bars window, which is the expected behaviour of any structural tool and not a defect. The Active Level projection ribbon is a visual planning aid, not a forecast. Past level behaviour does not guarantee future behaviour.
🔸 Risk Disclosure
Trading involves substantial risk and is not suitable for every investor. This script is published for educational and analytical purposes only. Users are solely responsible for their own trading decisions, position sizing and risk management. Always test any tool on your own instruments and timeframes before using it in a live environment.
Release Notes
UPDATE NOTES - V1.8This update focuses on source cleanup, active-level ownership, panel standardization, and visual readability.
The core purpose of the script remains unchanged.
This release improves how the existing support/resistance survival 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
------------------------
* Removed the non-required legal block from the source header.
The script now follows the current AGPro public-free source format without an extra legal header.
* Preserved the original Level Survival engine.
Pivot detection, support/resistance flipping, close respect, penetration damage, reaction quality, test fatigue, active-level selection, focus zone, projection ribbon, and cluster fading remain intact.
* Added an Active Level Badge.
The active support or resistance zone can now show a separate centered badge with the active level type, survival score, and test count.
* Added active badge controls.
Show Active Level Badge and Active Badge Anchor were added so the highlighted level can be clearly owned without changing the engine.
* Expanded font-size support.
Label and panel font controls now include Huge.
------------------------
Visual Improvements
------------------------
* Improved active-zone ownership by adding a centered badge to the active level or projection area.
* Preserved the premium low-noise support/resistance map style.
* Kept weaker non-focus levels faded so the active structural battlefield remains easy to read.
* Increased the default right-label offset slightly so labels sit farther from the active candle cluster.
* Active badge text uses a clean two-line format: ACTIVE SUP/RES and SURVIVAL score with test count.
------------------------
Interface & Usability
------------------------
* Moved panel controls into a dedicated Panel group.
* Added Elite Dark, Slate, and Clean Light panel themes.
* Expanded panel locations to include top, middle, and bottom center positions.
* Added live panel repositioning through table.set_position.
* Panel header now follows the AGPro render order: table.clear -> table.merge_cells -> header.
* Panel header remains a single merged blue row with only the script name.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
Support/resistance detection, survival scoring, level flipping, focus selection, and cluster filtering should be interpreted the same way as before.
The goal is to improve clarity and usability, not to introduce new predictive behavior.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, timeframe differences, and repeated tests may affect how survival scores and active levels 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.9This update focuses on readability, decision clarity, and added context.
The core purpose of the script remains unchanged.
This release improves how the existing level-survival logic is presented and interpreted on the chart, adds a Defense Rate that reviews tested levels against their own history, and turns the panel into a more decision-oriented read.
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
------------------------
• New Defense Rate row (proof)
A new panel row reports the share of confirmed level tests where price closed back fully on the defended side (above support or below resistance). It is counted only on confirmed bars, reads "Building (n)" until at least 6 tests exist, and is color-graded by tier. It is a backward-looking statistic, not a signal.
• New Action read
The two static explanation rows were replaced by an Action read that summarizes what the current Active Level is doing now: strong support or resistance, holding, fragile, eroded, or broken. It is descriptive and intended to guide interpretation, not to instruct trades.
• Adaptive text contrast on every badge and label
On-chart level labels, the centered Active Level badge, and panel value cells now choose dark or light text automatically based on the badge color, so gold, pink, and bright support or resistance badges stay legible at a glance.
• Removed redundant Active Level labelling
When the centered Active Level badge is shown, the Active Level no longer also draws a duplicate right-side label, reducing visual repetition around the highlighted zone.
• Consistent label font size
All on-chart labels and badges now follow the single Label Font Size setting, so the size you choose is applied uniformly across the map.
• Clearer Damage State color steps
The Damage State accent now distinguishes Moderate from High with its own tone for a more readable severity scale.
------------------------
Visual Improvements
------------------------
• Improved chart readability with contrast-aware label and badge text on every survival tier.
• Reduced visual clutter by removing the duplicate Active Level label.
• Added vertical de-collision for right-side level labels so close levels no longer overlap, while each level line stays on its true price.
• Refined visual hierarchy so the Active Level, its badge, and the panel Action read stand out clearly.
• Kept labels positioned to the right of the last bar so they do not overlap price action.
------------------------
Interface & Usability
------------------------
• Optimized the panel by replacing two static explanation rows with a Defense Rate and an Action read for a clearer information flow.
• Improved label and badge legibility with automatic text color.
• Adjusted the panel so survival, damage, defense, and action read top to bottom as a single decision summary.
• Enhanced overall user experience without changing the core scoring logic.
------------------------
Behavior Notes
------------------------
This update does not change the core analytical logic of the script.
Level detection, the Survival Score components (close respect, penetration damage, reaction quality, test fatigue), flips, and clustering work as before. The Defense Rate and Action read are descriptive summaries layered on top of the existing engine.
Users should interpret outputs the same way as before, now with improved visual structure and added context.
------------------------
Limitations Reminder
------------------------
The script remains a rule-based analytical tool.
Market conditions such as volatility, liquidity, and timeframe differences may affect how levels, scores, and the Defense Rate appear. The Defense Rate reflects only the level tests seen in the loaded history on the current symbol and timeframe and will vary between instruments and chart settings.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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
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.