Adaptive Momentum RibbonWhat It Does
Adaptive Momentum Ribbon (AMR) is a directional momentum tool that identifies shifts in price equilibrium and marks them directly on the price chart with entry labels and dynamic invalidation levels. It pairs a robust statistical oscillator with a Keltner Channel envelope to give traders both timing signals and volatility context in a single overlay.
How It Works
The indicator is built on three independent components working together:
1. Median Absolute Deviation (MAD) Z-Score
Instead of using a standard deviation z-score (which is heavily influenced by outlier candles and spike wicks), AMR calculates a rolling median of price, then measures how far price has deviated from that median, normalized by the Median Absolute Deviation. MAD is a statistical measure of dispersion that is approximately 50% more resistant to outliers than standard deviation. The raw MAD value is scaled by 1.4826 to make it directly comparable to standard deviation under normal distribution assumptions. The result is a z-score that reflects genuine shifts in price positioning rather than reacting disproportionately to single volatile bars.
2. Butterworth Low-Pass Filter
The raw z-score is then passed through a second-order Butterworth low-pass filter. Unlike cascaded EMAs (which introduce cumulative lag at each stage), the Butterworth filter is designed to have a maximally flat frequency response in the passband. This means it preserves the shape of genuine momentum moves while attenuating high-frequency noise. The filter's two-pole design provides a steeper roll-off than any single-pole smoothing method, delivering cleaner zero-line crossovers with less delay.
3. Keltner Channel Envelope
A standard Keltner Channel (moving average +/- ATR multiple) provides volatility context. Unlike Bollinger Bands, which use standard deviation and tend to expand/contract sharply on individual outlier bars, Keltner Channels use Average True Range, producing smoother, more stable bands that account for gap behavior and true intrabar range.
Signal Logic
A bullish signal (upward label) fires when the filtered z-score crosses above zero, indicating that price has shifted above its rolling median by a statistically meaningful amount after smoothing.
A bearish signal (downward label) fires when the filtered z-score crosses below zero.
Each signal generates an invalidation level (dashed line), placed at the low (for bullish) or high (for bearish) of the signal bar, offset by a long-term volatility measure (100-period EMA of True Range). If price breaches this level, an X marker appears, indicating the signal's premise has been violated.
The invalidation level extends forward in real time until it is either breached or replaced by a new signal in the opposite direction.
How to Use It
Trend Confirmation: Use the signal labels alongside the Keltner Channel. Bullish signals firing near the lower KC band suggest mean-reversion opportunities. Bullish signals near or above the midline suggest trend continuation.
Invalidation as Risk Management: The dashed invalidation line can serve as a reference for stop-loss placement. When the X appears, the statistical basis for the entry no longer holds.
Parameter Guidance:
Momentum Period (default 20): Controls the lookback for the median and MAD calculation. Shorter periods react faster but produce more signals. Longer periods are smoother but slower.
Butterworth Smoothing (default 3): Controls noise filtering. A value of 1 passes the raw z-score through with minimal filtering. Values of 3-5 work well for most timeframes.
KC settings: Standard Keltner Channel parameters. The defaults (20 EMA, 14 ATR, 2x multiplier) are widely used and work across most instruments and timeframes.
Limitations and Honest Caveats
This indicator does not predict future price. It identifies statistical shifts in recent price positioning relative to a rolling median. These shifts may or may not lead to sustained moves.
Like all zero-crossing oscillators, it will generate false signals during choppy, range-bound markets. The Keltner Channel can help filter these visually (signals near the midline in a flat channel are lower conviction).
The invalidation levels are references, not guaranteed stop levels. Slippage and gaps can cause exits beyond these prices.
The MAD z-score assumes sufficient data variation. In extremely low-volatility environments where price barely moves, the MAD can approach zero. A fallback to standard deviation is built in for this edge case, but signals during such periods should be treated with extra caution.
No repainting. All signals fire on the confirmed close of the signal bar and reference the prior bar's high/low for level placement. No future data is accessed.
Summary
AMR combines outlier-robust statistics (MAD z-score), signal-processing-grade smoothing (Butterworth filter), and volatility-adaptive context (Keltner Channel) into a single chart overlay. It is designed for traders who want clean directional signals with built-in invalidation logic, without relying on indicators that overreact to spike wicks or require a separate oscillator pane.
Pine Script® indicator






















