Ehlers Adaptive Trend Filter + Consensus Engine v12Ehlers Adaptive Trend Filter + Consensus Engine
From TrendMatrix Labs: Our core mission is to bridge the gap between advanced quantitative methods and intuitive, actionable visual trading. We built this engine because standard retail moving averages lag too heavily and fall apart during choppy, bracketed markets. We wanted an institutional-grade toolkit that leverages true Digital Signal Processing (DSP) to eliminate lag, paired with a robust matrix-style screener so you can manage an entire watchlist from a single chart. This script is the culmination of extensive mathematical architecture refinement and live market testing.
The Ehlers Adaptive Trend Filter + Consensus Engine combines advanced digital signal processing techniques developed by John Ehlers with a multi-symbol consensus screening framework. It is designed to identify true trend strength, catch emerging opportunities, and flag deteriorating market conditions across an entire watchlist simultaneously.
Unlike traditional moving averages, this indicator uses low-lag Ehlers filters and adaptive cycle analysis to separate meaningful trend signals from market noise while maintaining absolute responsiveness during rapid regime shifts.
Key Features
1. Adaptive Trend Detection
Choose from multiple Ehlers-based filtering methods to match your specific trading horizon:
2-Pole + 2-Pole (Fast): Maximum responsiveness for active swing traders.
3-Pole + 2-Pole (Hybrid): Balanced trend detection and noise reduction.
3-Pole + 3-Pole (Smooth): Heavy trend filtering designed to eliminate whipsaws.
MAMA/FAMA (Adaptive): Market-cycle adaptive filtering using a faithful execution of Ehlers' famous MESA (Maximum Entropy Spectral Analysis) methodology.
💡 Engine Tip: We built an auto-calibration mode directly into the script. When you swap timeframes (e.g., from a Daily chart down to a 1-Hour chart), the lookbacks, dynamic detox periods, and volatility safety margins automatically scale themselves so you never have to constantly fiddle with the input settings.
2. Dynamic Support Baseline
A secondary adaptive baseline acts as a strict structural trend qualification filter.
When the signal path remains above the baseline, the asset is locked in a healthy trend.
When the signal path falls below the baseline, the trend structure is considered compromised.
The visual trend zone between the signal path and the baseline provides an instant, intuitive look at trend maturity and safety margins.
3. Volatility-Adaptive Analysis
Traditional fixed thresholds fail when applied across different asset classes or volatile market regimes. This script automatically scales its internal calculations using a rolling historical volatility percentile, providing highly accurate, normalized readings for Price Deviation, Trend Extension, Safety Margins, and Technical Quality.
4. Advanced Reversal & Momentum Engine (v12 Rebuilt)
The reversal section has been completely upgraded to match the mathematical rigor of the core trend engine. It completely bypasses simple slope checks, utilizing a multi-dimensional conviction score (0–100) based on:
Epistemic Disagreement: Catching early cycle shifts when the ultra-responsive Adaptive filter diverges from the slower core structural lines.
2nd Derivative Acceleration: Measuring the actual rate of change of the filter separation (the acceleration of the trend).
Volatility Compression: Evaluating structural spreads against a rolling 100-bar 20th percentile to catch explosive expansions breaking out of tight consolidations.
Visuals: Optional background highlights cleanly map out these precise bullish and bearish divergence zones where structural trend and velocity disagree.
The Consensus Engine Screener
The built-in dashboard simultaneously evaluates every symbol in your custom watchlist across three completely independent trend frequencies: FAST (2P+2P), CORE (3P+2P), and ADAPTIVE (MAMA/FAMA).
Assets are assigned a clear structural tier based on exactly how many independent filters agree:
Elite (3/3 Bullish): All filters are perfectly aligned. This indicates the strongest trend environment and the highest-conviction buying opportunities.
Confirmed (2/3 Bullish): The macro trend remains healthy, but a single higher-frequency filter has begun to pull back. Excellent for monitoring trend maturity.
Emerging (1/3 Bullish): Early-stage developments where the zero-phase adaptive model detects improving conditions before the broader trend confirms. This is your primary hunter tool for spotting fresh reversals.
Bear (0/3 Bullish): Complete bearish alignment. Crucial for portfolio risk management, short-side tracking, and identifying weak market segments.
Institutional Ranking & Interpretive Aids
Instead of just telling you an asset is up, the ranking engine scores your watchlist using a Calmar-adjusted weighted separation model that blends filter distance, consensus agreement, localized volatility, and multi-period returns. You can fully customize the weights of the filters to natively match your trading style.
To completely eliminate cognitive load when monitoring up to 40 tickers, the optional Interpretation Engine automatically synthesizes these underlying metrics into clear, contextual action tags displayed right on your dashboard:
ENTRY · ADD · HOLD · CAUTION · TRIM · WATCH · AVOID
This is highly practical for identifying a "Bleeding Elite" asset—a stock that technically still ranks in the top tier but is flagged with a TRIM · Mature+fading tag because its internal momentum and filter separation are decaying.
Ideal For
Trend-Following & Swing Traders: Looking for clean entries with minimized lag.
Portfolio Managers: Needing to instantly separate leading assets from laggards across custom matrix watchlists.
Market Breadth Analysts: Looking to see exactly how many stocks in a sector are healthy versus how many are internally fracturing.
Top-Down Visual Execution: Use the screener on a macro timeframe (like Daily) to find your clean setups, then drop timeframes (like the 15-Min or 1-Hour) and use the real-time DSP directional arrows to perfectly time your mean-reversion expansions.
Penunjuk Pine Script®






















