Ehlers MESA Adaptive Moving Average

May 24, 2015

Static chart image
Signals
Cycle
Moving Averages

The Ehlers MESA Adaptive Moving Average indicator provides a dynamic trend-following system that adjusts its reactivity based on price phase changes measured by the Hilbert Transform Discriminator. This tool aims to reduce lag during trending periods while maintaining smoothness during consolidation, offering a high-efficiency signal through its dual-line (MAMA and FAMA) structure.

Usage

The Usage section describes how the script can be used, examples should be provided in this section. This tool functions as a standalone trend-following system or a signal filter. Users typically look for the interaction between the MESA Adaptive Moving Average (MAMA) and the Following Adaptive Moving Average (FAMA).

  • Trend Identification: When the MAMA is above the FAMA, the trend is considered bullish. Conversely, when the MAMA is below the FAMA, the trend is considered bearish.
  • Crossover Signals: A crossover of the MAMA over the FAMA can be used as a potential entry or exit signal. The "Mark Crossover Points" setting can be enabled to highlight these events on the chart with visual icons.
  • Ribbon Mode: By enabling the "Fill MAMA/FAMA Region" setting, the space between the two averages is colored, creating a visual ribbon that helps identify trend strength and volatility.
  • Bar Coloring: The "Enable Bar Colors" setting changes the color of price bars based on the relative position of the MAMA and FAMA, assisting in rapid trend assessment.

Details

The script is based on John Ehlers' MESA Adaptive Moving Average (MAMA) algorithm. Unlike standard moving averages that use a fixed period, MAMA adapts to the rate of change of the phase of the market cycle.

The calculation utilizes a Hilbert Transform Discriminator to compute the phase of the cycle. This phase change determines the alpha (smoothing factor) used for the moving average. The result is a "fast attack" average that follows price closely when the phase changes rapidly and a "slow decay" average that holds its value when price movement slows down. The FAMA (Following Adaptive Moving Average) is derived from the MAMA, providing a secondary smoothed signal line that exhibits even less vertical movement, effectively acting as a signal line with minimal lag.

Settings

  • Source: Determines the price data used for the calculations (default is hl2).
  • Fast Limit: Sets the upper bound for the adaptive alpha value, controlling how quickly the indicator reacts to fast price movements.
  • Slow Limit: Sets the lower bound for the adaptive alpha value, ensuring the indicator maintains a minimum level of smoothing.
  • Mark Crossover Points: When enabled, plots visual shapes on the chart whenever the MAMA and FAMA cross.
  • Fill MAMA/FAMA Region: When enabled, applies a background fill between the MAMA and FAMA lines to create a visual ribbon.
  • Enable Bar Colors: When enabled, colors the price bars based on the current trend state (MAMA vs. FAMA).

FAQ

How do I interpret the relationship between MAMA and FAMA? The MAMA is the primary fast-acting line, while the FAMA is the secondary signal line. A bullish trend is indicated when MAMA is above FAMA, and a bearish trend is indicated when MAMA is below FAMA.

Why does the indicator seem to "staircase" during flat markets? This is a feature of the MAMA algorithm. It is designed to hold its value (ratchet) until a significant phase change occurs, which helps avoid whipsaws in sideways markets.

How can I access the Ehlers MESA Adaptive Moving Average tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
ninjatraderNinjaTrader
metatrader4MetaTrader 4/5
thinkorswimThinkorswim

Unlock Unlimited Access to the LuxAlgo Library

Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.