MAMA (Ehlers) MESA Adaptive Moving Average
Mar 30, 2020

The MAMA (Ehlers) MESA Adaptive Moving Average indicator provides a sophisticated trend-following framework that adapts its smoothing factor based on the phase rate of the market's dominant cycle. This tool aims to reduce lag significantly while maintaining smooth price tracking, offering traders a more responsive alternative to traditional moving averages.
Usage
The MAMA indicator is used to identify trend direction and potential reversal points by analyzing the relationship between two adaptive lines: the MESA Adaptive Moving Average (MAMA) and the Following Adaptive Moving Average (FAMA).
- Trend Identification: When the MAMA line is above the FAMA line, the market is considered to be in a bullish trend. Conversely, when the MAMA line is below the FAMA line, the market is in a bearish trend.
- Crossover Signals: Traders often look for crossovers between MAMA and FAMA as entry or exit signals. A "Long" signal is typically generated when FAMA crosses under MAMA, while a "Short" signal is generated when FAMA crosses over MAMA.
- Adaptability: Because the alpha (smoothing factor) is determined by the phase of the market cycle, the indicator responds rapidly to price changes during trending moves and slows down during sideways or cyclic phases to avoid whipsaws.
Details
Developed by John Ehlers, the MESA Adaptive Moving Average (MAMA) utilizes a homodyne discriminator to determine the instantaneous phase of the market. Unlike standard exponential moving averages that use a fixed alpha, MAMA adjusts its smoothing based on the rate of change of the phase.
The script executes several complex signal processing steps:
- Price Smoothing: A 4-tap WMA is applied to the median price.
- Quadrature Components: The script calculates InPhase (I) and Quadrature (Q) components to transform price data into the frequency domain.
- Phase Calculation: By determining the arctangent of the ratio of these components, the script finds the current phase of the cycle.
- Alpha Calculation: The difference in phase (delta phase) determines the alpha. This ensures that the average adapts its speed to the market's current volatility and cycle position.
- FAMA Generation: The Following Adaptive Moving Average (FAMA) is calculated by applying a secondary smoothing to the MAMA values, resulting in a signal that follows MAMA with an added lag, facilitating crossover identification.
Settings
- Fast Limit: Sets the maximum limit for the alpha value. A higher fast limit allows the indicator to respond more aggressively to rapid price movements.
- Slow Limit: Sets the minimum limit for the alpha value. This ensures that even in non-trending markets, the indicator maintains a baseline level of smoothing and does not stop updating.
FAQ
How do I interpret the MAMA and FAMA lines? The MAMA line is the primary adaptive average, while the FAMA line is a derivative of MAMA that acts as a synchronized signal line. Crossovers between these two lines indicate potential shifts in market momentum and trend direction.
What makes this indicator "adaptive" compared to an EMA? A standard EMA uses a fixed smoothing constant. This indicator calculates a unique smoothing constant (alpha) for every bar based on the rate of change of the market cycle's phase, allowing it to "speed up" during trends and "slow down" during consolidation.
How can I access the MAMA (Ehlers) MESA Adaptive Moving Average? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.