OPEN-SOURCE SCRIPT

TDL Adaptive Session Zones Pro

101
🔷 What This Indicator Does

TDL Adaptive Session Zones Pro maps high-probability reaction areas where price is statistically more likely to pause, reverse, or accelerate — based on real historical session data, not arbitrary levels.

Unlike static support and resistance tools, these zones automatically adapt to changing market volatility every session. When volatility contracts, zones tighten. When it expands, zones widen. The result is a dynamic framework that reflects how the market is actually behaving right now.

This indicator is built for intraday traders who want structure and context — not signals.

🔷 Core Components

1️⃣ Adaptive Percentile Zones (Session-Based S/R)

The engine of this indicator. It works by:
• Collecting historical intraday session ranges over a configurable lookback period (default 20 sessions)
• Calculating percentile distances (25th, 50th, 75th, 100th by default) from that data
• Projecting those distances symmetrically above and below the current session open
• Resetting and recalculating every session automatically

🟩 Lower zones → Statistically derived support reaction areas
🟥 Upper zones → Statistically derived resistance reaction areas

Outer zones (higher percentile) represent more extreme price extensions and carry greater significance when tested. Inner zones represent typical intraday range behavior.

The key insight: instead of drawing arbitrary lines, these zones tell you where price has historically found the edges of its range — adjusted for current conditions.

2️⃣ Strike / Round Number Levels (Liquidity Reference)

Plots round-number price levels at configurable intervals (50, 100, etc.) from the session open. These levels frequently act as liquidity concentration areas in index futures and options markets.

• Configurable interval spacing
• Min/Max distance controls
• Optional mid-strike gap levels (dotted)
• Session-bounded display

Useful for NQ, ES, and index derivatives where options strike prices create natural liquidity clusters.

3️⃣ Previous Day OHLC Reference

Plots Previous Day Open, High, Low, and Close as intraday reference levels — widely observed by both retail and institutional participants.

• All four levels with distinct color coding
• Configurable line style (solid, dashed, dotted)
• Clean labels for quick identification

4️⃣ Opening Range Breakout (ORB)

Captures the high and low of the first N minutes of the session (configurable: 5 to 60 minutes). The opening range provides useful context when combined with the adaptive percentile zones.

• Configurable time window
• Filled range visualization
• Session-bounded display

🔷 Optional Validation Filters

All filters are off by default and designed to help observe cleaner price behavior near important zones.

🔹 Candle Structure Validation
Filters out candles with excessive range (ATR multiple), small bodies (body/range %), or extreme wick imbalance. Helps isolate price action reflecting healthy market participation near key levels.

🔹 Rejection Wick Detection
Identifies candles with significant wick-to-body ratios (hammer-type structure), independent of candle color. Useful for spotting potential rejection behavior when price interacts with zone boundaries.

🔹 Volume Participation Filter
Highlights periods where volume exceeds the average by a configurable multiplier. Includes a confirmation window (number of bars following the spike) to allow for delayed reaction observation.

🔹 Daily Pivot
Classic pivot point (H+L+C)/3 plotted as a session-fixed reference level for additional market structure context.

🔹 Higher Timeframe Trend
Background color overlay based on a configurable HTF moving average. Supports SMA, EMA, WMA, and VWMA. Provides directional context without enforcing bias on the intraday analysis.

🔷 Confluence Highlight System

When price arrives near any key zone (percentile, strike, OHLC, ORB, or pivot) AND all enabled validation filters align on the same candle, that candle is highlighted in yellow.

⚠️ The yellow highlight is NOT a buy or sell signal. It indicates that price behavior appears structurally meaningful at an important market location based on your selected filter combination.

Three alertcondition() calls are included: Bullish confluence, Bearish confluence, and Any confluence — ready for TradingView alerts.

🔷 Session Volatility Gauge

Real-time dashboard (table overlay) showing what percentage of the median daily range has been consumed in the current session.

States:
• LOW (< 40%) — Session range is compressed relative to history
• BUILDING (40-70%) — Range is developing, room for expansion
• HEALTHY (70-100%) — Normal range consumption
• EXTENDED (> 100%) — Session exceeds typical range, potential exhaustion

This helps gauge whether the session still has room to move or is approaching statistical limits.


🔷 Zone Touch Tracker

Counts fresh touches on each percentile zone during the current session. A "touch" is registered when price enters a zone's proximity after being outside it. More touches on a zone suggest greater significance.

Displayed as a table overlay with per-zone counts for both resistance and support zones. Resets automatically each session.

🔷 Recommended Settings

NQ / ES Futures (5m–15m):
• Session: 0930-1600, Timezone: America/New_York
• Percentiles: 25 / 50 / 75 / 100 (default)
• Strike Interval: 100
• ORB: 15 minutes

Stocks (5m–15m):
• Strike Interval: 5 or 10
• Consider tightening percentiles (20 / 45 / 65 / 85) for lower-volatility names

Gold Futures (5m):
• Strike Interval: 10 or 25
• Adjust session window to your active trading hours

🔷 How To Use

1. Apply to an intraday chart (1m to 15m recommended)
2. Observe where price interacts with the adaptive percentile zones
3. Optionally enable one or more validation filters to highlight structurally clean candles at key zones
4. Use the Session Volatility Gauge to assess how much range has been consumed
5. Enable the Zone Touch Tracker to identify high-significance levels
6. Apply your own analysis, execution method, and risk management

This is a context and structure tool. It shows you WHERE you are within the session's statistical range — the trading decisions are yours.

🔷 Technical Notes

• Works on any intraday timeframe; designed for 1m to 15m
• Requires sufficient historical data for percentile calculations (minimum ~5 sessions)
• Session detection works correctly with extended hours both on and off
• All zone levels are session-bounded and reset automatically
• Open source — inspect, learn from, or adapt the code as you see fit

⚠️ Disclaimer

This script is provided for educational and informational purposes only. It does not generate buy or sell signals and does not constitute financial advice. Past performance of any trading methodology is not indicative of future results. Always apply independent analysis and proper risk management.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.