OPEN-SOURCE SCRIPT
Market Exhaustion [WavesUnchained]

Market Exhaustion [WavesUnchained]
Multi-oscillator exhaustion detector combining MFI + optional CCI, HTF bias, StochRSI timing, and a divergence engine with an Exhaustion Score (0-100).
CORE CONCEPT
- Detects exhaustion via regular divergences anchored on price pivots
- Scores each divergence (0-100) using 5 components
- Line width = quality, color = direction (never thicker than main line)
OSCILLATOR MODES
- MFI: Engine uses MFI only
- CCI: Engine uses CCI mapped to 0-100
- MFI+CCI: Both plotted, engine source selectable (MFI or CCI)
EXHAUSTION SCORE (0-100)
1. Sequence (Div 1/2/3...) - repeated attempts increase score
2. Fatigue - no new oscillator extreme over lookback
3. Formation Time - bars between pivots
4. Reaction - post-divergence bounce/drop vs ATR
5. Impulse - MFI/CCI delta + swing size
DIVERGENCE ENGINE
- Price-pivot anchored (LL/HH) with osc confirmation (HL/LH)
- OS/OB gating with dynamic zones + fallback to 20/80
- Tolerant direction checks (price + osc eps)
- Auto cleanup (max objects)
HTF CONTEXT
- Auto-HTF MFI bias label
- Optional HTF filter for signals
- Bias bonus (optional) for Exhaustion Score
SIGNALS & TIMING
- StochRSI timing + MFI zone confirmation
- Context + timing signals (L/S markers)
- Zone confirm bars
VISUALIZATION
- Color-coded MFI line (OB/OS/neutral)
- Optional CCI (mapped 0-100) line
- Divergence line width = quality, endpoint markers
- Optional mid-label with score
- Dynamic zones + optional fill
BEST USE CASES
- Reversal scouting at extremes
- Filtering weak swings
- 15M-4H swing exhaustion reads
- HTF bias + divergence confluence
Version: 1.0.0
Author: WavesUnchained
Pine Script: v6
Multi-oscillator exhaustion detector combining MFI + optional CCI, HTF bias, StochRSI timing, and a divergence engine with an Exhaustion Score (0-100).
CORE CONCEPT
- Detects exhaustion via regular divergences anchored on price pivots
- Scores each divergence (0-100) using 5 components
- Line width = quality, color = direction (never thicker than main line)
OSCILLATOR MODES
- MFI: Engine uses MFI only
- CCI: Engine uses CCI mapped to 0-100
- MFI+CCI: Both plotted, engine source selectable (MFI or CCI)
EXHAUSTION SCORE (0-100)
1. Sequence (Div 1/2/3...) - repeated attempts increase score
2. Fatigue - no new oscillator extreme over lookback
3. Formation Time - bars between pivots
4. Reaction - post-divergence bounce/drop vs ATR
5. Impulse - MFI/CCI delta + swing size
DIVERGENCE ENGINE
- Price-pivot anchored (LL/HH) with osc confirmation (HL/LH)
- OS/OB gating with dynamic zones + fallback to 20/80
- Tolerant direction checks (price + osc eps)
- Auto cleanup (max objects)
HTF CONTEXT
- Auto-HTF MFI bias label
- Optional HTF filter for signals
- Bias bonus (optional) for Exhaustion Score
SIGNALS & TIMING
- StochRSI timing + MFI zone confirmation
- Context + timing signals (L/S markers)
- Zone confirm bars
VISUALIZATION
- Color-coded MFI line (OB/OS/neutral)
- Optional CCI (mapped 0-100) line
- Divergence line width = quality, endpoint markers
- Optional mid-label with score
- Dynamic zones + optional fill
BEST USE CASES
- Reversal scouting at extremes
- Filtering weak swings
- 15M-4H swing exhaustion reads
- HTF bias + divergence confluence
Version: 1.0.0
Author: WavesUnchained
Pine Script: v6
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.