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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.