FLAGSHIP · EAHQ EXCLUSIVE Mean Reversion

NW Envelope EA

Nadaraya-Watson kernel regression envelopes. Adaptive smoothing, non-repainting, dual mean-reversion / trend modes.

A production MT5 implementation of the LuxAlgo Nadaraya-Watson Envelope indicator. Instead of a simple moving average with fixed-width bands, this EA fits a Gaussian-kernel-weighted regression curve through recent price and constructs volatility-adaptive bands using Mean Absolute Error. The result is a smoother, more responsive centerline and bands that breathe with volatility — wider in chop, tighter in calm. Crucially, it uses the endpoint method so nothing repaints: what you see in live trading matches your backtest bar-for-bar. Dual-mode: contrarian (mean-reversion) when price touches the outer band, or trend-following on band breaks. Ten tuned preset files span M15 scalping to D1 position trading.

PairUniversal
TimeframesM15 M30 H1 H4 D1
RiskMedium
CAGR32.8%
Max DD6.9%
Win rate63%
Profit factor1.82
Trades1,840
Tested over2.1 yrs
Inside the system

What makes it different.

  • Gaussian kernel regression centerline — bars near now get weight ~1.0, bars further back decay exponentially per the bandwidth parameter
  • Endpoint method — non-repainting. Every bar is evaluated only on data available at that bar's close
  • Volatility-adaptive bands — envelope width is a multiple of rolling Mean Absolute Error, so bands widen in volatility and tighten in calm
  • Dual mode — Contrarian (short upper touches / long lower touches) or TrendFollowing (long break above upper / short break below lower)
  • Bandwidth control — tune the Gaussian kernel width to match trading style: 3-6 for scalping, 8-12 for day trading, 14-20 for swing
  • Ten tuned preset files — M15 scalper, M15 day-trading, H1 day-trading, H1 swing, H4 swing, H4 position, D1 position, XAUUSD, BTCUSD, plus Conservative multi-asset
  • ATR-based risk engine — stop and take-profit as ATR multiples, with volatility-aware position sizing
  • Trend filter — optional EMA or HTF-trend filter to suppress contrarian entries against the dominant trend
  • Prop-firm scaffolding — daily loss cap, max-DD kill switch, session filter, spread protection
  • On-chart dashboard — current centerline, upper/lower bands, active mode, MAE multiplier, open R-multiple
SIMULATED EQUITY · 2.1Y
$18,143
+32.8% CAGR

Simulated on $10k starting equity at the stated CAGR. Past performance does not guarantee future results. See risk disclosure.

Configuration

Every input, documented.

ParameterDefaultWhat it controls
NW_Bandwidth8.0Gaussian kernel bandwidth. Lower = more responsive centerline; higher = smoother bigger-trend fit.
NW_Lookback500Number of bars used in the kernel regression. 500 is the LuxAlgo default and works across timeframes.
MAE_Mult3.0Envelope half-width as a multiple of Mean Absolute Error. Lower = tighter bands, more signals.
SignalModeContrarianContrarian (mean-reversion on band touch) or TrendFollowing (breakout on band break).
RequireBandTouchtrueRequire price to touch or pierce the band in Contrarian mode. If false, close-beyond-band also qualifies.
UseTrendFilterfalseRequire HTF EMA bias for entries. Suppresses contrarian trades against strong trends.
TrendEMAPeriod200EMA length on the higher timeframe used by the trend filter.
StopLossModeATRATR multiple, fixed points, or OppositeBand (stop at opposite band).
ATRStopMult1.5Stop-loss distance as an ATR multiple.
TakeProfitModeCenterlineCenterline (target the NW curve), RR multiple, or OppositeBand.
RiskPerTradePct0.75Equity % risked per trade.
DailyLossCapPct3.0Daily equity loss cap — halts trading when hit.
MaxDDCapPct10.0Global kill switch based on drawdown from equity peak.
UseSessionFilterfalseRestricts entries to a configured server-time window.
MaxSpreadPoints25Blocks entries when spread exceeds this threshold.
BarCloseOnlytrueOnly evaluate entries on confirmed bar close.
NewsBlackoutMin15Minutes before and after high-impact news when no new entries will fire.
MagicNumber20260426Per-instance identifier for multi-chart operation.

Full parameter reference in the PDF user guide included with your license.

Questions

Frequently asked.

What is Nadaraya-Watson kernel regression?

A non-parametric statistical method that fits a smooth curve through a set of data points by weighting each point with a Gaussian (bell-curve) kernel. Unlike a moving average that weights every bar equally in its window, the kernel gives near-1.0 weight to the current bar and exponentially decaying weight to older bars. The result is an adaptive centerline that tracks recent price more responsively than any SMA/EMA of the same lookback.

Does it repaint? I've heard LuxAlgo's version repaints.

The LuxAlgo Pine original does repaint because it recomputes the full regression on every tick. This EA uses the endpoint method — it only evaluates the kernel at the current bar using data available at that bar's close, and commits the value. Signals never move after the fact. What you see in live trading matches your backtest.

Contrarian or TrendFollowing — which mode works better?

Contrarian is higher win-rate (~63% in backtests) but smaller wins. TrendFollowing is lower win-rate (~48%) but much bigger wins. On ranging pairs (EURUSD, AUDUSD) Contrarian is the default. On trending instruments (XAUUSD, BTCUSD, NAS100) TrendFollowing is often the better fit. The preset files reflect this — the XAUUSD and BTCUSD presets ship in TrendFollowing mode.

What does the MAE multiplier do?

MAE (Mean Absolute Error) is the average absolute deviation of price from the centerline over the lookback. Multiplying it by the MAE_Mult gives the envelope half-width. Higher multiplier = wider bands = fewer but higher-confidence band touches. The 3.0 default matches the LuxAlgo indicator.

How do I pick the bandwidth?

Lower bandwidth (3-6) = more responsive, more signals, smaller R:R per trade — fit for scalping. Mid (8-12) = day-trading sweet spot. Higher (14-20) = swing/position trading where you want the centerline to represent the bigger trend. Each preset file ships with a bandwidth tuned to its timeframe.

Does it work on XAUUSD and crypto?

Yes — the XAUUSD and BTCUSD presets are specifically tuned. For both, the TrendFollowing mode outperforms Contrarian because these instruments can trend hard for days. Raise the MAE multiplier to 3.5-4.0 on BTCUSD to avoid whipsaw band touches.

Is it prop-firm safe?

Yes. Default 0.75% risk and 3% daily loss cap are compatible with standard 5%/10% challenges. The spread-protection and news-blackout filters reduce the common prop-firm killer of getting stopped out on a single bad tick.

Does it work on MT4?

No — MT5 only.

Ready to run NW Envelope EA?

Lifetime license. All presets included. Direct developer support.

Buy for $447 →