NLMS Volatility Trail Adaptive Trend Signal Filter
- 지표
- 버전: 1.0
- 활성화: 5
NLMS Volatility Trail Adaptive Trend Signal Filter
Overview
NLMS Volatility Trail MultiFilter is a technical analysis indicator for MetaTrader 4 engineered to detect directional trend transitions, suppress short-term price noise, and project structured risk-to-reward target levels directly on the price chart. The tool unifies four core analytical components within a single chart window: a Normalized Least Mean Squares (NLMS) adaptive trend-tracking engine, an Average True Range (ATR) volatility trailing envelope, a modular 15-filter technical confirmation suite, and an automated visual Stop Loss (SL) and Take Profit (TP) projection overlay. Every signal evaluation and internal weight adaptation is executed strictly on completed bars, providing consistent, non-repainting historical and real-time visual references across Forex currency pairs, precious metals, equity indices, and other liquid instruments.
Operating Principle
The indicator processes market price data through a deterministic multi-stage pipeline on every completed bar to maintain signal stability and eliminate intra-bar false triggers:
- Stage 1 - Adaptive Baseline Estimation: The core engine applies an adaptive finite-impulse-response filter (NLMS) across a configurable window of past closed candle prices. By normalizing step-size adjustments against local input energy, the filter adapts smoothly to changing price velocity while remaining numerically stable during low-volatility consolidations.
- Stage 2 - ATR Volatility Trailing Envelope: Around the adaptive baseline, the indicator constructs upper and lower volatility boundaries scaled by a short-period Average True Range and user-defined multiplier. The resulting trailing line ratchets in the direction of prevailing momentum and holds its level during minor counter-trend pullbacks until volatility boundaries are breached.
- Stage 3 - Directional Regime State Detection: When closed-bar price momentum drives the trailing boundary past its prior directional threshold, the indicator registers a bullish or bearish regime transition and updates its three-state color buffers seamlessly without visual gaps between consecutive bars.
- Stage 4 - Strict Closed-Bar Evaluation (Non-Repainting Architecture): Candidate Buy and Sell signals are evaluated exclusively on closed candles (Bar 1 and older). The actively forming candle (Bar 0) never triggers signal arrows or weight updates. Once a candle closes and a signal arrow is plotted, that signal remains permanently fixed on the chart and will not shift, vanish, or repaint upon chart refresh or timeframe switching.
- Stage 5 - Modular 15-Filter Confluence Gate: Before any candidate regime transition is accepted, it must pass every enabled module within the integrated 15-filter confirmation suite. All active filters operate in strict logical conjunction: if any enabled trend, momentum, oscillator, candlestick, or structural filter disagrees with the candidate direction on the closed bar, the signal is suppressed.
- Buy Signal Conditions: A confirmed Buy arrow is plotted below the low of the closed signal bar when the adaptive volatility trail transitions from a neutral or bearish state into a confirmed bullish upward trajectory, and every enabled confirmation filter validates bullish market alignment.
- Sell Signal Conditions: A confirmed Sell arrow is plotted above the high of the closed signal bar when the adaptive volatility trail transitions from a neutral or bullish state into a confirmed bearish downward trajectory, and every enabled confirmation filter validates bearish market alignment.
- Exit and Risk-to-Reward Target Projection Logic: Because this product is an analytical indicator rather than an automated order-execution Expert Advisor, trade management is guided visually on the chart. Upon confirming the latest signal, the indicator captures the signal candle closing price as the reference Entry level, measures local ATR volatility, and projects a 1R Stop Loss level alongside three progressive Take Profit targets at 1R (TP1), 2R (TP2), and 3R (TP3), or until an opposing confirmed directional trail transition occurs.
Key Features
- Strict Non-Repainting Closed-Bar Execution: Signal arrows and internal adaptive filter states are finalized solely after candle closure, ensuring identical historical and live signal placement for reliable visual chart review.
- Three-State Color-Coded Volatility Trail: Plots a continuous trailing line directly over price action that transitions cleanly between neutral (gray), bullish (lime green), and bearish (red) states without broken line segments.
- Modular 15-Filter Confirmation Suite: Integrates 15 independent technical confirmation filters spanning trend direction, momentum oscillators, volatility bands, smoothed candlesticks, and swing price structure, each controlled by an individual boolean toggle.
- Automated Dynamic ATR SL and Multi-TP Overlay: Automatically draws horizontal reference lines and right-aligned price tags for Entry, Stop Loss (1R), TP1 (1R), TP2 (2R), and TP3 (3R) anchored to the latest confirmed signal bar and extended into the right chart margin.
- Structured Multi-Channel Alert Telemetry: Supports MetaTrader 4 pop-up alert windows, distinct WAV sound playback for Buy and Sell events, and mobile push notifications formatted with instrument symbol, timeframe, signal side, Entry, SL, TP1, TP2, and TP3 values, with duplicate-alert protection per closed bar.
- Clean Chart Object Lifecycle Management: Creates and updates all target level lines and price labels under a unique internal prefix and automatically deletes all graphical objects when the indicator is removed or reinitialized.
Operation and Setup Recommendations
- Recommended Instruments: Designed for major and minor Forex currency pairs (such as EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD), spot gold (XAUUSD), and major equity indices. Users should inspect symbol spread and tick specifications on their broker feed before live application.
- Supported Timeframes: Compatible with all standard MetaTrader 4 chart timeframes from M1 to MN1. Intraday traders commonly deploy the indicator on M15, M30, and H1 charts, while swing traders utilize H4 and D1 charts to capture sustained directional swings.
- Broker Account Specifications: Operates identically on both Hedging and Netting MetaTrader 4 account types across standard and ECN execution environments. Low-spread broker feeds are advisable when applying smaller ATR multipliers or lower intraday timeframes.
- Modular Filter Configuration Workflow: By default, all 15 confirmation filters are set to false so traders can observe the baseline NLMS Volatility Trail behavior directly. Users can selectively enable individual filters or combine complementary categories—such as pairing a macro trend filter (Double MA, Ichimoku Senkou Span B, or Supertrend) with an oscillator momentum filter (ADX, MACD, or RSI) or structural zone filter (Support/Resistance or Fibonacci)—to align signal frequency with their analytical methodology.
- Graphical User Interface (GUI) Visual Legend:
- Lime Green Trail Line: Denotes an active bullish directional regime along the adaptive volatility trail.
- Red Trail Line: Denotes an active bearish directional regime along the adaptive volatility trail.
- Gray Trail Line: Denotes an initial or neutral transitional state prior to confirmed directional breakout.
- Aqua Upward Arrow (Wingdings Code 233): Marks a confirmed closed-bar Buy signal positioned below the signal candle low by the configured point offset.
- Red Downward Arrow (Wingdings Code 234): Marks a confirmed closed-bar Sell signal positioned above the signal candle high by the configured point offset.
- Gold Solid Line: Marks the reference Entry price level equal to the closing price of the confirmed signal candle.
- Red Dashed Line: Marks the calculated Stop Loss (SL) price level positioned 1.0x the configured ATR risk distance away from Entry.
- Lime Green, Medium Sea Green, and Dodger Blue Dashed Lines: Mark progressive Take Profit projection levels at 1R (TP1), 2R (TP2), and 3R (TP3) reward-to-risk multiples with right-side price labels.
- Alert Configuration Requirements: To receive mobile alerts, configure your MetaQuotes ID under MetaTrader 4 Tools -> Options -> Notifications. To hear WAV alerts, enable sound events under Tools -> Options -> Events and verify that the specified audio files exist inside the terminal Sounds directory.
- Terminal Performance and Resource Management: Upon initial attachment, the indicator requires at least 100 historical bars (or InpTaps + InpAtrPeriod + 50 bars, whichever is larger) to warm up internal filter buffers. Subsequent real-time ticks execute incremental calculations only across recent bars. When activating multiple filters simultaneously—especially swing lookback modules such as Support/Resistance or ZigZag-anchored Fibonacci—avoid running the indicator across an excessive number of simultaneous charts on terminals with constrained CPU or memory resources.
Input Parameters
Note: Read-only string divider variables (InpGroupEntry, InpGroupSignal, InpGroupTarget, and InpFilter1 through InpFilter15) serve solely as visual section headers inside the MetaTrader 4 Inputs tab. All functional parameters are listed below by group:
Group 1: Entry Logic - NLMS and Volatility Trail Settings
- InpTaps (Default: 2): Past closed price bars (filter tap length) processed by the adaptive filter; must be 2 or greater, where higher values increase smoothing over broader price history (bars).
- InpMu (Default: 0.1): Adaptive step-size learning rate governing how rapidly filter weights respond to closed-bar price changes; lower values yield smoother tracking (coefficient).
- InpEps (Default: 0.5): Regularization constant added to squared input energy denominator to prevent numerical instability during quiet, low-range markets (constant).
- InpAtrPeriod (Default: 7): Lookback period used to compute Average True Range for the core volatility trailing envelope (bars).
- InpAtrFactor (Default: 0.5): Multiplier applied to trail ATR value to set upper and lower channel distances; larger values widen the trail against minor pullbacks (multiplier).
- InpSource (Default: PRICE_CLOSE): Applied candle price series (Close, Open, High, Low, Median, Typical, Weighted) supplied to the adaptive trail engine (enum).
Group 2: Signal Display and Notification Settings
- InpShowBuySell (Default: true): Toggles plotting of confirmed Buy and Sell arrows on the main chart without affecting the trail line or target levels (boolean).
- InpArrowOffset (Default: 30): Vertical spacing distance placed between signal candle low or high and the plotted Buy or Sell arrow (points).
- InpAlertOnSignal (Default: false): Enables MetaTrader 4 pop-up alert dialog boxes when a confirmed signal occurs on closed Bar 1 (boolean).
- InpPushNotify (Default: false): Enables mobile push notifications containing Entry, SL, and TP1-TP3 levels sent via MetaQuotes ID on confirmed signals (boolean).
- InpPlaySound (Default: false): Enables playback of local WAV sound files when a confirmed Buy or Sell signal is generated on Bar 1 (boolean).
- InpBuySound (Default: alert.wav): Filename of WAV audio file inside the terminal Sounds folder played upon a confirmed Buy signal (string).
- InpSellSound (Default: alert2.wav): Filename of WAV audio file inside the terminal Sounds folder played upon a confirmed Sell signal (string).
Group 3: Target Levels - ATR and SL/TP Settings
- InpShowTargetLevels (Default: true): Toggles horizontal Entry, Stop Loss, and three Take Profit projection lines and labels for the latest confirmed signal (boolean).
- InpAtrTargetPeriod (Default: 7): Lookback period for ATR calculation used to measure initial stop-loss risk distance on the signal bar (bars).
- InpAtrMultiplier (Default: 1.5): Multiplier applied to target ATR value to define the 1R Stop Loss distance from signal entry price (multiplier).
- InpExtendBars (Default: 1): Number of bar intervals to project horizontal Entry, SL, and TP lines to the right beyond the active candle (bars).
- InpFontSize (Default: 8): Text font size used for price level labels anchored at the right end of each target projection line (font points).
- InpColorEntry (Default: clrGold): Color assigned to solid horizontal Entry reference line and its right-side price label (color).
- InpColorSL (Default: clrRed): Color assigned to Stop Loss (SL) projection line and its right-side price label (color).
- InpColorTP1 (Default: clrLimeGreen): Color assigned to first Take Profit target line at 1R reward-to-risk and its price label (color).
- InpColorTP2 (Default: clrMediumSeaGreen): Color assigned to second Take Profit target line at 2R reward-to-risk and its price label (color).
- InpColorTP3 (Default: clrDodgerBlue): Color assigned to third Take Profit target line at 3R reward-to-risk and its price label (color).
- InpTargetStyle (Default: STYLE_DASH): Line drawing style (solid, dash, dot, dash-dot, dash-dot-dot) applied to SL and TP projection lines (enum).
- InpLineWidth (Default: 1): Line thickness for SL and TP projection lines; solid Entry line renders thicker at InpLineWidth + 1 (pixels).
Group 4: Confirmation Filter 1 - RSI Cross Filter
- Use_RSI_Cross_Filter (Default: false): Enables filtering requiring RSI to cross upward out of oversold for Buy or downward out of overbought for Sell (boolean).
- RSI_Length (Default: 14): Lookback calculation period for Relative Strength Index cross filter (bars).
- RSI_Price_Source (Default: PRICE_CLOSE): Applied candle price type used in RSI cross calculation (enum).
- RSI_Oversold (Default: 30.0): Lower RSI threshold that oscillator must cross above on the closed signal bar to permit a Buy signal (RSI level).
- RSI_Overbought (Default: 70.0): Upper RSI threshold that oscillator must cross below on the closed signal bar to permit a Sell signal (RSI level).
Group 5: Confirmation Filter 2 - ADX Trend Strength Filter
- Use_ADX_Filter (Default: false): Enables minimum trend strength validation using Average Directional Index main line (boolean).
- ADX_Period (Default: 10): Lookback calculation period for ADX trend-strength indicator (bars).
- ADX_Min_Level (Default: 20.0): Minimum ADX reading required on the signal bar to confirm sufficient trend strength before permitting signals (ADX level).
Group 6: Confirmation Filter 3 - Single Moving Average Filter
- Use_MA_Filter (Default: false): Enables directional trend filtering requiring close price above Moving Average for Buy and below for Sell (boolean).
- MA_Period (Default: 50): Averaging lookback period for single trend Moving Average (bars).
- MA_Method (Default: MODE_SMA): Moving Average smoothing algorithm (SMA, EMA, SMMA, LWMA) applied to trend filter (enum).
- MA_Shift (Default: 0): Horizontal bar displacement applied to single Moving Average buffer (bars).
Group 7: Confirmation Filter 4 - Ichimoku Senkou Span B Filter
- Use_Ichimoku_Filter (Default: false): Enables filtering signals against Ichimoku Kinko Hyo Senkou Span B baseline (close above Buy, below Sell) (boolean).
- Ichimoku_Tenkan (Default: 9): Lookback period for Ichimoku Tenkan-sen (Conversion Line) parameter (bars).
- Ichimoku_Kijun (Default: 26): Lookback period for Ichimoku Kijun-sen (Base Line) parameter (bars).
- Ichimoku_SenkouB (Default: 52): Lookback period for Ichimoku Senkou Span B (Leading Span B) baseline (bars).
Group 8: Confirmation Filter 5 - Long-Period RSI Midline Filter
- Use_RSI75_Filter (Default: false): Enables macro momentum filtering requiring long-period RSI above 50.0 midline for Buy and below 50.0 for Sell (boolean).
- RSI_Filter_Period (Default: 75): Lookback calculation period for long-term RSI midline trend filter (bars).
Group 9: Confirmation Filter 6 - Double Moving Average Alignment Filter
- Use_DoubleMA_Filter (Default: false): Enables dual Moving Average alignment requiring fast MA A above slow MA B for Buy and below for Sell (boolean).
- MA_A_Period (Default: 30): Averaging period for fast Moving Average (MA A) (bars).
- MA_A_Method (Default: MODE_EMA): Smoothing method applied to fast Moving Average (MA A) (enum).
- MA_A_Applied (Default: PRICE_CLOSE): Applied candle price series used to compute fast Moving Average (MA A) (enum).
- MA_A_Shift (Default: 0): Horizontal bar shift applied to fast Moving Average (MA A) (bars).
- MA_B_Period (Default: 140): Averaging period for slow Moving Average (MA B) (bars).
- MA_B_Method (Default: MODE_EMA): Smoothing method applied to slow Moving Average (MA B) (enum).
- MA_B_Applied (Default: PRICE_CLOSE): Applied candle price series used to compute slow Moving Average (MA B) (enum).
- MA_B_Shift (Default: 0): Horizontal bar shift applied to slow Moving Average (MA B) (bars).
Group 10: Confirmation Filter 7 - Awesome Oscillator Filter
- Use_AO_Filter (Default: false): Primary toggle enabling Awesome Oscillator (AO) momentum confirmation sub-filters (boolean).
- Use_AO_Volume_Filter (Default: false): Enables minimum AO amplitude thresholds (AO_Buy_Min and AO_Sell_Max) when Use_AO_Filter is active (boolean).
- AO_Buy_Min (Default: 4.0): Minimum positive AO histogram value required on signal bar to permit Buy in amplitude mode (oscillator value).
- AO_Sell_Max (Default: -4.0): Maximum negative AO histogram value required on signal bar to permit Sell in amplitude mode (oscillator value).
- Use_AO_Color_Filter (Default: false): Enables bar-over-bar AO histogram slope confirmation (rising for Buy, falling for Sell) (boolean).
- Use_AO_Zero_Filter (Default: false): Enables combined AO zero-line polarity and slope validation (positive and rising Buy; negative and falling Sell) (boolean).
Group 11: Confirmation Filter 8 - Parabolic SAR Filter
- Use_SAR_Filter (Default: false): Enables Parabolic Stop and Reverse (SAR) directional filtering (close above SAR dot for Buy, below for Sell) (boolean).
- SAR_Step (Default: 0.02): Initial and incremental acceleration step factor for Parabolic SAR calculation (factor).
- SAR_Maximum (Default: 0.2): Maximum acceleration factor ceiling for Parabolic SAR calculation (factor).
Group 12: Confirmation Filter 9 - Heiken Ashi Candle Filter
- Use_HeikenAshi_Filter (Default: false): Enables smoothed Heiken Ashi candle body polarity filtering (close above open for Buy, below for Sell) (boolean).
Group 13: Confirmation Filter 10 - CCI Zero-Line Trend Filter
- Use_CCI_Filter (Default: false): Enables Commodity Channel Index (CCI) zero-line directional filtering (CCI above 0.0 for Buy, below 0.0 for Sell) (boolean).
- CCI_Period (Default: 50): Lookback calculation period for CCI zero-line trend filter (bars).
- CCI_Applied (Default: PRICE_CLOSE): Applied candle price source used in CCI trend calculation (enum).
Group 14: Confirmation Filter 11 - CCI Overbought and Oversold Filter
- Use_CCI_OBOS_Filter (Default: false): Enables extreme momentum filtering requiring CCI beyond overbought or oversold thresholds (boolean).
- CCI_OBOS_Period (Default: 14): Lookback calculation period for CCI overbought/oversold filter (bars).
- CCI_OBOS_Applied (Default: PRICE_CLOSE): Applied candle price source used in CCI OB/OS calculation (enum).
- CCI_Overbought (Default: 100.0): Upper CCI threshold level that must be exceeded to validate bullish momentum (CCI level).
- CCI_Oversold (Default: -100.0): Lower CCI threshold level that momentum must drop below to validate bearish momentum (CCI level).
Group 15: Confirmation Filter 12 - Relative Vigor Index (RVI) Filters
- Use_RVI_Filter (Default: false): Enables RVI main line zero-level directional filtering (above 0.0 for Buy, below 0.0 for Sell) (boolean).
- RVI_Period (Default: 75): Lookback calculation period for RVI zero-line trend filter (bars).
- Use_RVI_Signal_Filter (Default: false): Enables RVI main line versus signal line alignment filtering (main above signal for Buy, below for Sell) (boolean).
- RVI_Signal_Period (Default: 20): Lookback calculation period for RVI main-versus-signal alignment filter (bars).
Group 16: Confirmation Filter 13 - MACD Histogram and Zero-Line Filters
- Use_MACD_Filter (Default: false): Enables MACD histogram polarity filtering (MACD main line above signal line for Buy, below for Sell) (boolean).
- MACD_FastEMA (Default: 12): Fast Exponential Moving Average period for MACD calculation (bars).
- MACD_SlowEMA (Default: 26): Slow Exponential Moving Average period for MACD calculation (bars).
- MACD_SignalSMA (Default: 9): Signal line Simple Moving Average smoothing period for MACD calculation (bars).
- MACD_Applied (Default: PRICE_CLOSE): Applied candle price source used in MACD calculation (enum).
- Use_MACD_Zero_Filter (Default: false): Enables MACD main line zero-level directional filtering (above 0.0 for Buy, below 0.0 for Sell) (boolean).
Group 17: Confirmation Filter 14 - Support/Resistance and Fibonacci Filters
- Use_SR_Filter (Default: false): Enables swing Support and Resistance zone proximity validation requiring signal candle interaction near recent levels (boolean).
- SR_Period (Default: 50): Number of closed lookback bars scanned to locate recent Support lows and Resistance highs (bars).
- SR_Zone_Points (Default: 80): Price tolerance band around detected Support or Resistance levels for wick or body interaction (points).
- Use_Fib_Filter (Default: false): Enables swing-based Fibonacci retracement zone validation requiring signal bar overlap with target retracement band (boolean).
- Fib_Level_1 (Default: 0.382): First Fibonacci retracement ratio boundary defining target retracement zone (ratio).
- Fib_Level_2 (Default: 0.618): Second Fibonacci retracement ratio boundary defining target retracement zone (ratio).
- ZigZag_Depth (Default: 12): Minimum bar depth lookback parameter used to identify swing highs and lows for Fibonacci anchoring (bars).
- ZigZag_Deviation (Default: 5): Minimum price deviation required to register a new swing pivot point (points).
- ZigZag_Backstep (Default: 3): Minimum bar separation required between consecutive swing pivot points (bars).
Group 18: Confirmation Filter 15 - Supertrend Filter
- Use_Supertrend_Filter (Default: false): Enables ATR-based Supertrend directional regime alignment filtering (uptrend for Buy, downtrend for Sell) (boolean).
- ST_AtrPeriod (Default: 10): Lookback period for Wilder's ATR calculation inside the Supertrend filter module (bars).
- ST_Factor (Default: 3.0): Volatility multiplier applied to ATR to compute upper and lower Supertrend bands (multiplier).
Risk Disclaimer
Trading foreign exchange, commodities, indices, and other leveraged financial instruments carries significant risk and may not be suitable for all investors. Past performance, historical chart signals, or backtesting results do not guarantee future results. This indicator is an analytical software tool intended solely to assist with technical chart analysis and does not constitute financial or investment advice. Always test the product thoroughly on a demo account to understand its operational behavior before considering deployment in live trading environments.
