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
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.