OPEN-SOURCE SCRIPT
MNQ Quant Oscillator Lab v2.1

MNQ Quant Oscillator Lab v2.1 — Clean Namespaces
Adaptive LinReg Oscillator + Auto Regime Switching + MTF Confirmation + MOEP Gate + Research Harness
MNQ Quant Oscillator Lab is a research-grade oscillator framework designed for MNQ/NQ (and other liquid futures/indices) on 1-minute and intraday timeframes. It combines a linear-regression-based detrended oscillator with quant-style normalization, adaptive parameterization, regime switching, multi-timeframe confirmation, and an optional MOEP (Minimum Optimal Entry Point) gate. The goal is to provide a customizable signal laboratory that is stable in real time, non-repainting by default, and suitable for systematic experimentation.
What this indicator does
1) Core oscillator (quant-normalized)
The indicator computes a linear regression (LinReg) detrended signal and expresses it as a z-scored oscillator for portability across volatility regimes and assets. You can switch the oscillator “transform family” via Oscillator type:
LinReg Residual / Residual Z: detrended residual (mean-reversion sensitive)
LinReg Slope Z: regression slope (trend-derivative sensitive)
LogReturn Z: log-return oscillator (momentum-style)
VolNorm Return Z: volatility-normalized returns (risk-scaled)
This yields a single oscillator that is comparable over time, not tied to raw point values.
2) Adaptive length (dynamic calibration)
When enabled, the regression length is automatically adapted using a volatility-regime proxy (ATR% z-scored → logistic mapping). High volatility typically shortens the effective lookback; low volatility allows longer lookbacks. This helps the oscillator remain responsive during expansions while staying stable in compressions.
Important: the adaptive logic is implemented with safe warmup behavior, so it will not throw NaN errors on early bars.
3) Adaptive thresholds (dynamic bands)
Instead of static overbought/oversold levels, the indicator can compute dynamic upper/lower bands from the oscillator’s own distribution (rolling mean + sigma). This creates thresholds that adjust automatically to regime changes.
4) Auto regime switching (Trend vs Mean Reversion)
With Auto regime switch enabled, the indicator selects whether to behave as a Trend system or a Mean Reversion system using an interpretable heuristic:
Trend regime when EMA-spread is strong relative to ATR and ATR is rising
Otherwise defaults to Mean Reversion
This prevents running mean-reversion logic in trend breakouts and reduces “mode mismatch.”
5) Multi-timeframe (MTF) confirmation (optional)
MTF confirmation can be enabled to require that the higher timeframe oscillator sign aligns with the direction of the signal. This is useful for reducing noise on MNQ 1m by requiring higher-timeframe structure agreement (e.g., 5m or 15m).
6) MOEP Gate (optional “institutional” filter)
The MOEP gate is a confluence score filter intended to reduce low-quality signals. It aggregates multiple components into a 0–100 score:
BB/KC squeeze condition
Expansion proxy
Trend proxy
Momentum proxy (RSI-based)
Volume catalyst (volume z-score)
Structure break (highest/lowest break)
You can set:
Score threshold (minimum score required)
Minimum components required (forces diversity of evidence)
When enabled, a signal must satisfy both oscillator logic and MOEP confluence conditions.
7) Research harness (NON-CAUSAL, OFF by default)
A built-in research mode evaluates signals using future bars to compute basic forward excursion statistics:
MFE (max favorable excursion)
MAE (max adverse excursion)
Simple win-rate proxy based on MFE vs MAE
This feature is strictly for offline analysis and tuning. It is disabled by default and should not be considered “live-safe” because it uses future information for evaluation.
Signals and interpretation
Mean Reversion regime
Long: oscillator is below the lower band and turns back upward across it
Short: oscillator is above the upper band and turns back downward across it
Trend regime
Long: oscillator crosses above zero (optionally requires structure break confirmation)
Short: oscillator crosses below zero (optionally requires structure break confirmation)
Hybrid
When Hybrid is selected (manual mode), the indicator allows both trend and mean-reversion triggers, but still respects the filters and gates you enable.
Recommended starting configuration (MNQ 1m)
If you want stable, high-quality signals first, then expand into research:
Use RTH only: ON
Auto regime switch: ON
Adaptive length: ON
Adaptive bands: ON
MTF confirmation: OFF initially (turn ON later with 5m)
MOEP Gate: OFF initially (turn ON after you confirm base behavior)
Research harness: OFF (only enable for tuning studies)
Practical notes / transparency
The indicator is designed to be stable on live bars (optional confirmed-bar behavior reduces flicker).
No repainting logic is used for signals.
Any “performance” numbers shown under Research harness are not tradable metrics; they are forward-looking evaluation outputs intended strictly for experimentation.
Disclaimer
This script is provided for educational and research purposes only and does not constitute financial advice. Futures trading involves substantial risk, including the possibility of loss exceeding initial investment.
Adaptive LinReg Oscillator + Auto Regime Switching + MTF Confirmation + MOEP Gate + Research Harness
MNQ Quant Oscillator Lab is a research-grade oscillator framework designed for MNQ/NQ (and other liquid futures/indices) on 1-minute and intraday timeframes. It combines a linear-regression-based detrended oscillator with quant-style normalization, adaptive parameterization, regime switching, multi-timeframe confirmation, and an optional MOEP (Minimum Optimal Entry Point) gate. The goal is to provide a customizable signal laboratory that is stable in real time, non-repainting by default, and suitable for systematic experimentation.
What this indicator does
1) Core oscillator (quant-normalized)
The indicator computes a linear regression (LinReg) detrended signal and expresses it as a z-scored oscillator for portability across volatility regimes and assets. You can switch the oscillator “transform family” via Oscillator type:
LinReg Residual / Residual Z: detrended residual (mean-reversion sensitive)
LinReg Slope Z: regression slope (trend-derivative sensitive)
LogReturn Z: log-return oscillator (momentum-style)
VolNorm Return Z: volatility-normalized returns (risk-scaled)
This yields a single oscillator that is comparable over time, not tied to raw point values.
2) Adaptive length (dynamic calibration)
When enabled, the regression length is automatically adapted using a volatility-regime proxy (ATR% z-scored → logistic mapping). High volatility typically shortens the effective lookback; low volatility allows longer lookbacks. This helps the oscillator remain responsive during expansions while staying stable in compressions.
Important: the adaptive logic is implemented with safe warmup behavior, so it will not throw NaN errors on early bars.
3) Adaptive thresholds (dynamic bands)
Instead of static overbought/oversold levels, the indicator can compute dynamic upper/lower bands from the oscillator’s own distribution (rolling mean + sigma). This creates thresholds that adjust automatically to regime changes.
4) Auto regime switching (Trend vs Mean Reversion)
With Auto regime switch enabled, the indicator selects whether to behave as a Trend system or a Mean Reversion system using an interpretable heuristic:
Trend regime when EMA-spread is strong relative to ATR and ATR is rising
Otherwise defaults to Mean Reversion
This prevents running mean-reversion logic in trend breakouts and reduces “mode mismatch.”
5) Multi-timeframe (MTF) confirmation (optional)
MTF confirmation can be enabled to require that the higher timeframe oscillator sign aligns with the direction of the signal. This is useful for reducing noise on MNQ 1m by requiring higher-timeframe structure agreement (e.g., 5m or 15m).
6) MOEP Gate (optional “institutional” filter)
The MOEP gate is a confluence score filter intended to reduce low-quality signals. It aggregates multiple components into a 0–100 score:
BB/KC squeeze condition
Expansion proxy
Trend proxy
Momentum proxy (RSI-based)
Volume catalyst (volume z-score)
Structure break (highest/lowest break)
You can set:
Score threshold (minimum score required)
Minimum components required (forces diversity of evidence)
When enabled, a signal must satisfy both oscillator logic and MOEP confluence conditions.
7) Research harness (NON-CAUSAL, OFF by default)
A built-in research mode evaluates signals using future bars to compute basic forward excursion statistics:
MFE (max favorable excursion)
MAE (max adverse excursion)
Simple win-rate proxy based on MFE vs MAE
This feature is strictly for offline analysis and tuning. It is disabled by default and should not be considered “live-safe” because it uses future information for evaluation.
Signals and interpretation
Mean Reversion regime
Long: oscillator is below the lower band and turns back upward across it
Short: oscillator is above the upper band and turns back downward across it
Trend regime
Long: oscillator crosses above zero (optionally requires structure break confirmation)
Short: oscillator crosses below zero (optionally requires structure break confirmation)
Hybrid
When Hybrid is selected (manual mode), the indicator allows both trend and mean-reversion triggers, but still respects the filters and gates you enable.
Recommended starting configuration (MNQ 1m)
If you want stable, high-quality signals first, then expand into research:
Use RTH only: ON
Auto regime switch: ON
Adaptive length: ON
Adaptive bands: ON
MTF confirmation: OFF initially (turn ON later with 5m)
MOEP Gate: OFF initially (turn ON after you confirm base behavior)
Research harness: OFF (only enable for tuning studies)
Practical notes / transparency
The indicator is designed to be stable on live bars (optional confirmed-bar behavior reduces flicker).
No repainting logic is used for signals.
Any “performance” numbers shown under Research harness are not tradable metrics; they are forward-looking evaluation outputs intended strictly for experimentation.
Disclaimer
This script is provided for educational and research purposes only and does not constitute financial advice. Futures trading involves substantial risk, including the possibility of loss exceeding initial investment.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.