Nadaraya Watson Envelope Indicator for MT5
- Indicatori
- Mohammad Taher Halimi Tabrizi
- Versione: 1.0
- Attivazioni: 5
Nadaraya-Watson Envelope Indicator for MT5
Overview
This indicator expands on the original Nadaraya-Watson smoothing methods by introducing a dynamic envelope system built using kernel regression. Unlike the standard Nadaraya-Watson estimator, this tool applies a contrarian approach: the envelope boundaries are designed to identify potential reversal zones when price extends too far from its smoothed trend estimate.
The indicator includes integrated alerts based on price crossings above or below the envelope bands. These signals are displayed as triangular markers, intentionally designed to remain on the chart in real time even when smoothing recalculations occur.
Users can choose between a repainting version for smoother visual output or a non-repainting version for stable, historically consistent results.
Usage
Non-Repainting Mode
In non-repainting mode, the indicator estimates the underlying trend using an endpoint Nadaraya-Watson estimator. The envelope boundaries are then derived by adding and subtracting the mean absolute deviation from this trend.
This produces results similar to classical channels or volatility bands, offering stable historical performance and clear reversal zones.
Repainting Mode
When repainting is enabled, the indicator uses a real-time Nadaraya-Watson estimator that updates continuously. While this can produce smoother envelopes, the historical output may shift.
Despite this, the triangle reversal markers always appear at the moment the cross occurs and remain locked in place, ensuring they are useful for real-time decision making.
Price moves beyond the upper or lower envelope often suggest potential mean-reversion opportunities. Crossings of the envelope boundaries generate the built-in reversal markers and can be used in alert conditions for signal automation.
Features
• Adaptive, kernel-smoothed envelope system
• Optional non-repainting trend estimation
• Real-time reversal markers for envelope crosses
• Integrated alert conditions for automated notifications
• Support for both contrarian trading and volatility-based analysis
Settings
Bandwidth
Controls the smoothness of the envelope. Higher values produce smoother, slower-responding bands.
Mult
Controls the envelope width by determining how far the boundary extends from the smoothed trend.
Source
Defines the input series for calculations (e.g., close, open, hl2).
Repainting Smoothing
Chooses between repainting and non-repainting versions of the estimator.

