OPEN-SOURCE SCRIPT
Unmitigated MTF High Low Pro - Cave Diving Bookmap Heatmap Plot

Unmitigated MTF High Low Pro - Cave Diving Bookmap Heatmap Plot
---
## 📖 Table of Contents
1. [What This Indicator Does](#what-this-indicator-does)
2. [Core Concepts](#core-concepts)
3. [Visual Components](#visual-components)
4. [The Cave Diving Framework](#the-cave-diving-framework)
5. [How to Use It for Trading](#how-to-use-it-for-trading)
6. [Settings & Customization](#settings--customization)
7. [Best Practices](#best-practices)
8. [Common Scenarios](#common-scenarios)
---
## What This Indicator Does
The **Unmitigated MTF High Low v2.0** tracks unmitigated (untouch) high and low levels across multiple timeframes, helping you identify key support and resistance zones that the market hasn't revisited yet. Think of it as a sophisticated memory system for price action - it remembers where price has been, and more importantly, where it *hasn't been back to*.
### Why "Unmitigated" Matters
In futures trading, especially on instruments like NQ and ES, the market has a tendency to revisit levels where liquidity was left behind. An "unmitigated" level is one that hasn't been touched since it was formed. These levels often act as magnets for price, and understanding their age and proximity gives you a significant edge in:
- **Entry timing** - Waiting for price to approach tested levels
- **Exit planning** - Taking profits before ancient resistance/support
- **Risk management** - Avoiding entries when approaching multiple old levels
- **Liquidity mapping** - Visualizing where orders likely cluster
---
## Core Concepts
### 1. **Sessions & Age**
The indicator uses **New York trading sessions** (6:00 PM to 5:59 PM NY time) as the primary time measurement. This aligns with how futures markets naturally segment their activity.
**Age Categories:**
- 🟢 **New (0-1 sessions)** - Fresh levels, recently formed
- 🟡 **Medium (2-3 sessions)** - Tested by time, gaining significance
- 🔴 **Old (4-6 sessions)** - Highly significant, survived multiple days
- 🟣 **Ancient (7+ sessions)** - Extreme significance, major support/resistance
The longer a level remains unmitigated, the more significant it becomes. Think of it like compound interest - time adds weight to these zones.
### 2. **Multi-Timeframe Tracking**
You can set the indicator to track high/low levels from any timeframe (default is 15 minutes). This means you're watching for unmitigated 15-minute highs and lows while trading on, say, a 1-minute or 5-minute chart.
**Why this matters:**
- Higher timeframe levels have more weight
- You can see multiple timeframe structure simultaneously
- Helps you avoid fighting larger timeframe momentum
### 3. **Mitigation**
A level becomes "mitigated" (deactivated) when price touches it:
- **High levels** are mitigated when price reaches or exceeds them
- **Low levels** are mitigated when price reaches or goes below them
Once mitigated, the level disappears from view. The indicator only shows you the untouch levels that still matter.
---
## Visual Components
### 📊 The Dashboard Table
Located in the corner of your chart (configurable), the table shows:
```
┌─────────┬───────────┬────────┬─────┬───────┐
│ Level │ Price │ Points │ Age │ % │
├─────────┼───────────┼────────┼─────┼───────┤
│ ↑↑↑↑↑ │ 21,450.25 │ +45.50 │ 8 │ +0.21%│ ← 5th High (Ancient)
│ ↑↑↑↑ │ 21,430.00 │ +25.25 │ 5 │ +0.12%│ ← 4th High (Old)
│ ↑↑↑ │ 21,420.50 │ +15.75 │ 3 │ +0.07%│ ← 3rd High (Medium)
│ ↑↑ │ 21,412.00 │ +7.25 │ 1 │ +0.03%│ ← 2nd High (New)
│ ↑ ⚠️ │ 21,408.25 │ +3.50 │ 0 │ +0.02%│ ← 1st High (Proximity Alert!)
├─────────┼───────────┼────────┼─────┼───────┤
│ 15 mins │ 🟢 │ Δ 8.75 │ 2U │ │ ← Status Row
├─────────┼───────────┼────────┼─────┼───────┤
│ ↓ ⚠️ │ 21,399.50 │ -5.25 │ 0 │ -0.02%│ ← 1st Low (Proximity Alert!)
│ ↓↓ │ 21,395.00 │ -9.75 │ 2 │ -0.05%│ ← 2nd Low (Medium)
│ ↓↓↓ │ 21,385.25 │ -19.50 │ 4 │ -0.09%│ ← 3rd Low (Old)
│ ↓↓↓↓ │ 21,370.00 │ -34.75 │ 6 │ -0.16%│ ← 4th Low (Old)
│ ↓↓↓↓↓ │ 21,350.75 │ -54.00 │ 9 │ -0.25%│ ← 5th Low (Ancient)
├─────────┼───────────┼────────┼─────┼───────┤
│ 📊 15↑ / 12↓ │ ← Statistics (optional)
└─────────┴───────────┴────────┴─────┴───────┘
```
**Reading the Table:**
- **Level Column**: Number of arrows indicates position (1-5), color shows age
- **Price**: The actual price level
- **Points**: Distance from current price (+ for highs, - for lows)
- **Age**: Number of full sessions since creation
- **%**: Percentage distance from current price
- **⚠️**: Proximity alert - price is within threshold distance
- **Status Row**: Shows timeframe, direction (🟢 bullish/🔴 bearish), tunnel width (Δ), and Strat pattern
### 📈 Visual Elements on Chart
**1. Level Lines**
- Horizontal lines showing each unmitigated level
- **Color-coded by age**: Bright colors = new, darker = older, deep purple/teal = ancient
- **Line style**: Customizable (solid, dashed, dotted)
- Automatically turn **yellow** when price gets close (proximity alert)
**2. Price Labels**
- Show the exact price and age: "21,450.25 (8d)"
- Fixed at small size for clean readability
- Positioned with configurable offset from current bar
**3. Bands (Optional)**
- Shaded zones between pairs of unmitigated levels
- Default: Between 1st and 2nd levels (the "tunnel")
- Can switch to 1st-3rd, 2nd-3rd, or disable entirely
- **Upper band** (pink/maroon) - Between unmitigated highs
- **Lower band** (blue/teal) - Between unmitigated lows
- These represent the "no man's land" or consolidation zones
---
## The Cave Diving Framework
This indicator is designed around the **Cave Diving Trading Framework** - a psychological and technical approach that maps cave diving safety protocols to futures trading risk management.
### 🤿 The Core Metaphor
**Cave diving has clear danger zones based on depth and overhead environment. Your trading should too.**
#### Shallow Water (New Levels, 0-1 Sessions)
- **Light**: Bright colors (bright red highs, bright green lows)
- **Psychology**: Fresh territory, recently tested
- **Trading**: Be aware but not overly concerned
- **Cave Diving Parallel**: You can see the surface, easy exit
#### Penetration Depth (Medium Levels, 2-3 Sessions)
- **Light**: Medium intensity colors
- **Psychology**: Building significance, market memory forming
- **Trading**: Start respecting these levels for entries/exits
- **Cave Diving Parallel**: Deeper in, need to track your line back
#### Deep Dive Zone (Old Levels, 4-6 Sessions)
- **Light**: Dark colors (deep maroon, dark blue)
- **Psychology**: Highly tested support/resistance
- **Trading**: Major decision points, plan accordingly
- **Cave Diving Parallel**: Significant overhead, careful navigation required
#### Overhead Environment (Ancient Levels, 7+ Sessions)
- **Light**: Very dark, purple/deep teal
- **Psychology**: Extreme caution required, major liquidity zones
- **Trading**: These are your "turn back" signals - don't fight ancient levels
- **Cave Diving Parallel**: Maximum danger, no room for error
### 🎯 The Proximity Alert System
Just like a cave diver's depth gauge that warns at critical thresholds, the proximity alerts (⚠️) tell you when you're entering a danger zone. When price gets within your configured threshold (default 5 points), the indicator:
- Highlights the level in **yellow** on the chart
- Shows **⚠️** in the table
- Signals: "You're entering a high-significance zone - adjust your position accordingly"
This prevents the trading equivalent of going deeper into a cave without checking your air supply.
---
## How to Use It for Trading
### 🎯 Entry Strategies
**1. The "Bounce Setup" (Mean Reversion)**
- Wait for price to approach an old or ancient unmitigated level
- Look for confluence: multiple levels nearby, bands narrowing
- Enter when price shows rejection (reversal candle patterns)
- **Example**: Price drops to a 6-session-old low, shows bullish engulfing → Long entry
**2. The "Break and Retest" (Trend Following)**
- Wait for price to break through an unmitigated level (mitigates it)
- Enter on the retest of the newly broken level
- **Example**: Price breaks above 4-session-old high → Wait for pullback to that level → Long entry
**3. The "Tunnel Trade" (Range Trading)**
- When bands are active, trade the range between 1st-2nd levels
- Short near upper band resistance, long near lower band support
- Exit at opposite side or when bands break
### 🚨 Risk Management Rules
**The Ancient Level Rule**
> Never fight ancient levels (7+ sessions). If you're long and approaching an ancient high, take profits. If you're short and approaching an ancient low, take profits.
These levels have survived a full trading week without being touched - there's likely significant liquidity and institutional interest there.
**The Proximity Exit Rule**
> When you see ⚠️ proximity alerts on multiple levels above/below your position, tighten stops or scale out.
This is your "overhead environment" warning. You're in dangerous territory.
**The New Level Filter**
> Be cautious taking positions based solely on new levels (0-1 sessions). Wait for them to age or combine with other confluence.
Fresh levels haven't been tested by time. They're like unconfirmed support/resistance.
### 📊 Reading Market Structure
**Bullish Structure (🟢 in status row)**
- Unmitigated lows are aging and holding
- Price respecting the lower band
- Old lows below acting as strong support
- **Bias**: Look for long entries at lower levels
**Bearish Structure (🔴 in status row)**
- Unmitigated highs are aging and holding
- Price respecting the upper band
- Old highs above acting as strong resistance
- **Bias**: Look for short entries at higher levels
**The Tunnel Compression**
- When the Δ (delta) in the status row is small, levels are tight
- This often precedes a breakout
- **Trading**: Wait for breakout direction, then trade the break
### 🔄 Strat Integration
The indicator shows Strat patterns in the status row:
- **1** - Inside bar (consolidation)
- **2U** - Broke high only (bullish)
- **2D** - Broke low only (bearish)
- **3** - Broke both (wide range, volatility)
Use these with the unmitigated levels:
- **2U near old high** → Potential resistance, watch for rejection
- **2D near old low** → Potential support, watch for bounce
- **3 pattern** → High volatility, respect wider stops
---
## Settings & Customization
### 📅 Session & Timeframe Settings
**HL Interval** (Default: 15 minutes)
- The timeframe for high/low calculation
- **Lower (1m, 5m)**: More levels, more noise, good for scalping
- **Higher (30m, 1H, 4H)**: Fewer levels, stronger significance, good for swing trading
- **Recommendation for NQ/ES**: 15m or 30m for day trading, 1H for swing trading
**Session Age Threshold** (Default: 2)
- How many sessions before a level is considered "old"
- Lower = more levels classified as old
- Higher = stricter definition of significance
### 📊 Level Display Options
**Show Level Lines**
- Toggle: Display horizontal lines for each level
- **Turn off** if you prefer a cleaner chart and only want the table
**Show Level Labels**
- Toggle: Display price labels on the chart
- **Turn off** for minimal visual clutter
**Label Offset**
- Distance (in bars) from current price bar to place labels
- Increase if labels overlap with price action
**Level Line Width & Style**
- Customize visual appearance
- **Thin solid**: Minimal distraction
- **Thick dashed**: High visibility
### 🎨 Age-Based Color Coding
Customize colors for each age category (high and low separately):
- **New (0-1 sessions)**: Default bright red/green
- **Medium (2-3 sessions)**: Default medium intensity
- **Old (4+ sessions)**: Default dark red/blue
- **Ancient (7+ sessions)**: Default deep purple/teal
**Color Strategy Tips:**
- Keep ancient levels in highly contrasting colors
- Use opacity (transparency) if you want subtler lines
- Match your chart's color scheme for aesthetic coherence
### 🎯 Band Settings
**Band Mode**
- **1st-2nd** (Default): The primary "tunnel" between most recent levels
- **1st-3rd**: Wider band, more room for price action
- **2nd-3rd**: Band between less immediate levels
- **Disabled**: No bands, lines only
**Band Colors & Borders**
- Customize fill color and border separately
- **Tip**: Keep bands very transparent (90-95% transparency) to avoid obscuring price action
### ⚠️ Proximity Alert Settings
**Enable Proximity Alerts**
- Toggle: Turn on/off the warning system
- When enabled, levels within threshold distance show ⚠️ and turn yellow
**Alert Threshold** (Default: 5.0 points)
- Distance in points to trigger the alert
- **For NQ**: 5-10 points is reasonable
- **For ES**: 2-5 points is reasonable
- **For MES/MNQ**: Scale down proportionally
**Alert Highlight Color**
- The color lines/labels turn when proximity is triggered
- Default: Yellow (high visibility)
### 📋 Table Settings
**Show Table**
- Toggle: Display the dashboard table
**Table Location**
- Top Left, Top Right, Bottom Left, Bottom Right
- Choose based on your chart layout and other indicators
**Text Size**
- Tiny, Small, Normal, Large
- **Recommendation**: Normal for 1080p monitors, Small for 4K
**Show % Distance**
- Toggle: Add percentage distance column to table
- Useful for comparing relative distances across different price ranges
**Show Statistics Row**
- Toggle: Show total count of unmitigated highs/lows
- Format: "📊 15↑ / 12↓" (15 unmitigated highs, 12 unmitigated lows)
- Useful for gauging overall market structure
### ⚡ Performance Settings
**Enable Level Cleanup**
- Automatically remove very old levels to maintain performance
- **Keep on** unless you want unlimited history
**Max Lookback Levels** (Default: 10,000)
- Maximum number of levels to track
- 10,000 ≈ 6+ months of 15-minute bars
- **Increase** if you want more history
- **Decrease** if experiencing performance issues
**Max Boxes Per Band** (Default: 245)
- TradingView limit is 500 total boxes
- With 2 bands, 245 each = 490 total (safe maximum)
---
## Best Practices
### 🎯 Position Management
**1. Scaling In Near Old Levels**
```
Price approaching 5-session-old low:
- First position: 30% size at proximity alert (⚠️)
- Second position: 40% size at exact level
- Third position: 30% size if it shows strong rejection
```
**2. Scaling Out Near Ancient Levels**
```
Holding long position, approaching 8-session-old high:
- Exit 50% at proximity alert (⚠️)
- Exit 30% at exact level
- Trail stop on remaining 20%
```
### 🧠 Trading Psychology Integration
Drawing from principles in *The Mountain Is You*, this indicator helps you:
**1. Recognize Self-Sabotage Patterns**
- **The Premature Entry**: Entering before price reaches your planned level
- **Solution**: Set alerts at unmitigated levels, wait for proximity warnings
- **The Profit-Taking Problem**: Exiting too early from fear
- **Solution**: Identify the next unmitigated level and commit to holding until proximity alert
- **The Loss Holding**: Refusing to exit losing trades
- **Solution**: When price breaks through and mitigates your entry level, it's telling you the structure changed
**2. Building Better Habits**
The color-coded age system trains your brain to:
- Respect levels that have proven themselves over time
- Distinguish between noise (new levels) and structure (old levels)
- Make decisions based on objective data, not fear or greed
**3. Emotional Regulation**
The proximity alerts serve as:
- **Circuit breakers** - Forcing you to re-evaluate before dangerous zones
- **Permission to act** - Giving you objective signals to exit without second-guessing
- **Validation** - Confirming when you're in alignment with market structure
### 📝 Pre-Market Routine
**Daily Setup Checklist:**
1. ✅ Identify the 3 nearest unmitigated highs above current price
2. ✅ Identify the 3 nearest unmitigated lows below current price
3. ✅ Note which are ancient (7+) - these are your "no-go" zones
4. ✅ Check the tunnel width (Δ in status row) - tight or wide?
5. ✅ Set alerts at the 1st high and 1st low for proximity warnings
6. ✅ Plan: "If we go up, I exit at ___. If we go down, I enter at ___."
### 🔄 Timeframe Confluence
**Multi-Timeframe Strategy:**
Run the indicator on **three instances**:
- **15-minute** (short-term structure)
- **1-hour** (intermediate structure)
- **4-hour** (major structure)
**Strong Setup**: When all three timeframes show unmitigated levels converging at the same price zone.
**Example:**
- 15m: Old low at 21,400
- 1H: Ancient low at 21,398
- 4H: Ancient low at 21,395
- **Result**: 21,395-21,400 is a monster support zone
### ⚠️ What This Indicator Doesn't Do
**Not a Crystal Ball**
- It doesn't predict where price will go
- It shows you where price *hasn't been* and how long it's been avoided
- The trading decisions are still yours
**Not an Entry Signal Generator**
- It provides context and structure
- You need to combine it with your entry methodology (price action, indicators, order flow, etc.)
**Not Foolproof**
- Ancient levels get broken
- Proximity alerts can trigger early in strong trends
- The market doesn't "owe" you a reversal at any level
---
## Common Scenarios
### Scenario 1: "Level Cluster Ahead"
**Situation**: You're long at 21,400. The table shows:
- 1st High: 21,425 (2 sessions old)
- 2nd High: 21,428 (3 sessions old)
- 3rd High: 21,435 (6 sessions old)
**Interpretation**: There's a resistance cluster just 25-35 points away. The 6-session-old level is particularly significant.
**Action**:
- Set first profit target at 21,420 (before the cluster)
- Set second target at 21,426 (between 1st and 2nd)
- Trail remaining position, but be ready to exit on rejection at 21,435
**Cave Diving Analogy**: You're approaching an overhead section with limited clearance. Lighten your load (reduce position) before entering.
---
### Scenario 2: "Ancient Level Approaches"
**Situation**: The market is grinding higher. You see ⚠️ appear next to a 9-session-old high at 21,500.
**Interpretation**: This level has survived over a week without being touched. Massive potential liquidity zone.
**Action**:
- If long, this is your absolute exit zone. Take profits before or at level.
- If looking to short, wait for clear rejection (price taps and reverses)
- Don't try to buy the breakout until it clearly breaks and retests
**Cave Diving Analogy**: Your dive computer is beeping - you've reached your planned turn-back depth. No matter how interesting it looks ahead, honor your plan.
---
### Scenario 3: "Mitigated Levels Create New Structure"
**Situation**: Price breaks and mitigates the 1st High. The previous 2nd High becomes the new 1st High.
**Interpretation**: The structure just shifted. What was the 2nd level is now most relevant.
**Action**:
- Watch how price reacts to the newly-mitigated level
- If it holds below (acts as resistance), bearish
- If it reclaims and holds above (acts as support), bullish
- The NEW 1st High is your next target/resistance
**Cave Diving Analogy**: You've passed through a restriction - the cave layout ahead is different now. Update your mental map.
---
### Scenario 4: "Tight Tunnel, Upcoming Breakout"
**Situation**: The Δ in the status row shows 3.25 points (very tight). Bands are converging.
**Interpretation**: Price is consolidating between very close unmitigated levels. Breakout likely.
**Action**:
- Don't try to predict direction
- Set alerts above 1st High and below 1st Low
- When break occurs, trade the retest
- Expect volatility - use wider stops
**Cave Diving Analogy**: You're in a narrow passage. Movement will be sudden and directional once it starts.
---
### Scenario 5: "Imbalanced Structure"
**Situation**: The statistics row shows "📊 22↑ / 7↓"
**Interpretation**: There are many more unmitigated highs than lows. This suggests:
- Price has been declining (hitting lows, leaving highs behind)
- Potential bullish reversal zone (lots of overhead supply mitigated)
- Or continued bearish structure (resistance everywhere above)
**Action**:
- Look at the age of those 22 highs
- If mostly new (0-2 sessions): Just a recent downmove, not significant yet
- If many old/ancient: Strong overhead resistance, be cautious on longs
- Compare to price action: Is price respecting the remaining lows?
**Cave Diving Analogy**: You've swam deeper than your starting point - most of your markers are above you now. Are you planning the ascent or going deeper?
---
## Final Thoughts: The Philosophy
This indicator is built on a simple but powerful principle: **The market has memory, and that memory has weight.**
Every unmitigated level represents:
- Liquidity left behind
- Orders waiting to be filled
- Institutional interest potentially parked
- Psychological significance for participants
The longer a level remains unmitigated, the more "charged" it becomes. When price finally revisits it, something significant usually happens - either a strong reversal or a definitive break.
Your job as a trader isn't to predict which outcome will occur. Your job is to:
1. **Recognize** when you're approaching these charged zones
2. **Respect** them by adjusting position size and risk
3. **React** appropriately based on how price behaves at them
4. **Remember** that ancient levels (like ancient wisdom) deserve extra reverence
The Cave Diving Framework embedded in this indicator serves as a constant reminder: Trading, like cave diving, requires rigorous respect for environmental hazards, meticulous planning, and the discipline to turn back when your limits are reached.
**Every proximity alert is the market asking you**: *"Do you really want to go deeper?"*
Sometimes the answer is yes - when your setup, confluence, and risk management all align.
Often, the answer should be no - and that's the trader avoiding the accident that would have happened to the gambler.
---
### 🎯 Quick Reference Card
**Color System:**
- 🟢 Bright colors = New (0-1 sessions) = Shallow water
- 🟡 Medium colors = Medium (2-3 sessions) = Penetration depth
- 🔴 Dark colors = Old (4-6 sessions) = Deep dive zone
- 🟣 Deep dark colors = Ancient (7+ sessions) = Overhead environment
**Symbols:**
- ↑ ↑↑ ↑↑↑ ↑↑↑↑ ↑↑↑↑↑ = High levels (1st through 5th)
- ↓ ↓↓ ↓↓↓ ↓↓↓↓ ↓↓↓↓↓ = Low levels (1st through 5th)
- ⚠️ = Proximity alert (danger zone)
- 🟢 = Bullish structure
- 🔴 = Bearish structure
- Δ = Tunnel width (distance between 1st high and 1st low)
**Critical Rules:**
1. Never fight ancient levels (7+ sessions)
2. Respect proximity alerts (⚠️)
3. Scale out near old/ancient resistance
4. Wait for confluence when entering
5. Let mitigated levels prove their new role
---
**Remember**: The indicator gives you structure. The trading edge comes from your discipline in respecting that structure.
Trade safe, trade smart, and always know your exit before your entry. 🎯
---
*"You don't become your best self by denying your patterns. You become your best self by recognizing them, understanding them, and choosing differently." - Adapted from The Mountain Is You*
In trading: You don't become profitable by ignoring market structure. You become profitable by recognizing it, understanding it, and choosing your entries accordingly.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.