OPEN-SOURCE SCRIPT
MSO - Market Stress Oscillator [WavesUnchained]

MSO - Market Stress Oscillator [WavesUnchained]
Bidirectional stress oscillator built on WVF + Z-score, with JMA/ADX filters, regime bias, and validated follow-through. Designed to expose downside panic vs upside euphoria and measure whether the market accepts or rejects each stress event.
Quick Setup
- Stress Color Mode: Intuitive (Downside=green, Upside=red) or Technical (classic colors).
CORE CONCEPT
- Downside stress: price flushes below WVF baseline (panic)
- Upside stress: price stretches above WVF baseline (euphoria)
- Stress is normalized via Z-score for cross-asset/timeframe robustness
ENGINE (BI-WVF + Z-SCORE)
- WVF Long and Short computed separately (panic vs euphoria)
- Z-score window normalizes extremes
- Thresholds are TF-aware (15m / 1h / 4h / D / W / M)
QUALITY FILTERS
- JMA trend filter (slope-based, low-lag)
- ADX minimum for trend strength
- Min Extreme Duration to avoid 1-bar noise
- Cooldown to prevent signal clustering
ACCEPT / REJECT LOGIC
- Events are evaluated after reactBars (forward follow-through)
- Accepted: follow-through >= minFollowATR
- Rejected: follow-through < minFollowATR
- Scores (0..1) optionally plotted as acceptance strength
BIAS / REGIME CONTEXT
- Bias line: zL - zS (who dominates)
- Bias band: regime threshold (only meaningful outside band)
- HTF Wind: higher-timeframe bias flip (JMA smoothed)
- Clarity Label: regime entry aligned with HTF + absBias threshold
VISUALIZATION
- Stress Lines: Red = downside stress (panic), Green = upside stress (euphoria)
- Bias Line: zL - zS (who dominates). Neutral inside band, colored outside.
- Bias Band: regime threshold. Fill shows when bias is usable.
- Zones: boxes at peak events (history preserved, FIFO capped)
- Chart Labels: DA/DR/UA/UR (or LA/LR/SA/SR) at peaks
- Lines: reaction window + peak level lines (FIFO capped)
STRESS COLOR MODE
- Intuitive: Downside stress = green, Upside stress = red (opportunity mapping)
- Technical: Downside stress = red, Upside stress = green (classic convention)
- This setting is visual only; logic, bias, and signals are unchanged
HOW TO USE
1. Read the stress lines: red spikes = panic risk, green spikes = euphoria risk.
2. Check bias: outside the band = usable regime; inside = noise.
3. Use DA/DR/UA/UR:
- DA/UA = stress accepted (follow-through confirmed)
- DR/UR = stress rejected (weak follow-through)
4. Add HTF wind: prefer signals aligned with HTF bias.
5. Tune presets by TF; use manual TF override for testing.
PRESETS & UI
- Full TF preset table (15m / 1h / 4h / D / W / M)
- Manual TF override for testing
- Preset summary panel (optional)
LOGGING (CSV)
- Pivot and stress logs for validation
- Early/First-pivot classification options
- Label IDs included for chart-to-log tracing
BEST USE CASES
- Panic/euphoria detection with follow-through validation
- Regime-aware context (bias + HTF wind)
- Multi-timeframe stress mapping (15m to Weekly)
Version: 1.0.0
Author: WavesUnchained
Pine Script: v6
Educational use only. Test thoroughly before live trading.
Bidirectional stress oscillator built on WVF + Z-score, with JMA/ADX filters, regime bias, and validated follow-through. Designed to expose downside panic vs upside euphoria and measure whether the market accepts or rejects each stress event.
Quick Setup
- Stress Color Mode: Intuitive (Downside=green, Upside=red) or Technical (classic colors).
CORE CONCEPT
- Downside stress: price flushes below WVF baseline (panic)
- Upside stress: price stretches above WVF baseline (euphoria)
- Stress is normalized via Z-score for cross-asset/timeframe robustness
ENGINE (BI-WVF + Z-SCORE)
- WVF Long and Short computed separately (panic vs euphoria)
- Z-score window normalizes extremes
- Thresholds are TF-aware (15m / 1h / 4h / D / W / M)
QUALITY FILTERS
- JMA trend filter (slope-based, low-lag)
- ADX minimum for trend strength
- Min Extreme Duration to avoid 1-bar noise
- Cooldown to prevent signal clustering
ACCEPT / REJECT LOGIC
- Events are evaluated after reactBars (forward follow-through)
- Accepted: follow-through >= minFollowATR
- Rejected: follow-through < minFollowATR
- Scores (0..1) optionally plotted as acceptance strength
BIAS / REGIME CONTEXT
- Bias line: zL - zS (who dominates)
- Bias band: regime threshold (only meaningful outside band)
- HTF Wind: higher-timeframe bias flip (JMA smoothed)
- Clarity Label: regime entry aligned with HTF + absBias threshold
VISUALIZATION
- Stress Lines: Red = downside stress (panic), Green = upside stress (euphoria)
- Bias Line: zL - zS (who dominates). Neutral inside band, colored outside.
- Bias Band: regime threshold. Fill shows when bias is usable.
- Zones: boxes at peak events (history preserved, FIFO capped)
- Chart Labels: DA/DR/UA/UR (or LA/LR/SA/SR) at peaks
- Lines: reaction window + peak level lines (FIFO capped)
STRESS COLOR MODE
- Intuitive: Downside stress = green, Upside stress = red (opportunity mapping)
- Technical: Downside stress = red, Upside stress = green (classic convention)
- This setting is visual only; logic, bias, and signals are unchanged
HOW TO USE
1. Read the stress lines: red spikes = panic risk, green spikes = euphoria risk.
2. Check bias: outside the band = usable regime; inside = noise.
3. Use DA/DR/UA/UR:
- DA/UA = stress accepted (follow-through confirmed)
- DR/UR = stress rejected (weak follow-through)
4. Add HTF wind: prefer signals aligned with HTF bias.
5. Tune presets by TF; use manual TF override for testing.
PRESETS & UI
- Full TF preset table (15m / 1h / 4h / D / W / M)
- Manual TF override for testing
- Preset summary panel (optional)
LOGGING (CSV)
- Pivot and stress logs for validation
- Early/First-pivot classification options
- Label IDs included for chart-to-log tracing
BEST USE CASES
- Panic/euphoria detection with follow-through validation
- Regime-aware context (bias + HTF wind)
- Multi-timeframe stress mapping (15m to Weekly)
Version: 1.0.0
Author: WavesUnchained
Pine Script: v6
Educational use only. Test thoroughly before live trading.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.