Ehlers MESA Adaptive Moving Average

Sep 26, 2017

Static chart image
Signals
Cycle
Moving Averages

The Ehlers MESA Adaptive Moving Average indicator provides a highly responsive trend-following tool that adapts its smoothing based on the cyclical nature of price action. By utilizing two distinct lines—the MAMA (MESA Adaptive Moving Average) and the FAMA (Following Adaptive Moving Average)—it offers a dynamic way to identify trend direction and potential market reversals with reduced lag compared to traditional moving averages.

Usage

The indicator is primarily used to identify trend changes through the interaction of its two component lines. The MAMA line acts as a fast-moving average that quickly reacts to price shifts, while the FAMA line provides a smoother, lagging reference point.

  • Trend Identification: When the MAMA line is above the FAMA line, the market is generally considered to be in an uptrend. Conversely, when the MAMA is below the FAMA, the market is in a downtrend.
  • Crossovers: Traders often look for "crossover" events as signals. A bullish signal occurs when the MAMA crosses above the FAMA, while a bearish signal occurs when the MAMA crosses below the FAMA.
  • Visual Enhancements: Users can toggle "Mark crossover points" to see visual arrows at every cross, or "Fill MAMA/FAMA Region" to highlight the gap between the two lines for better visual trend confirmation.
  • Bar Coloring: The "Enable Bar colors" setting allows the price bars to change color based on the current trend state (MAMA relative to FAMA), streamlining the analysis process.

Details

The MESA Adaptive Moving Average was developed by John Ehlers. The core concept involves using a Hilbert Transform to measure the dominant cycle period of the market. Unlike a standard Exponential Moving Average (EMA) that uses a fixed alpha (smoothing factor), MAMA adapts its alpha based on the phase rate of change.

This version includes the "ekoronin fix," which addresses specific calculation logic to ensure the adaptive smoothing remains consistent with Ehlers' intended mathematical framework. The FAMA line is unique because it is an average of the MAMA line, resulting in an even smoother output that stays in sync with the MAMA but with significantly less vertical movement, making it an effective support/resistance level or trend filter.

Settings

  • Source: Determines the price data used for calculation (e.g., HL2, Close).
  • Fast Limit: Sets the maximum limit for the adaptive alpha. A higher value makes the MAMA more responsive to price changes.
  • Slow Limit: Sets the minimum limit for the adaptive alpha, ensuring the indicator maintains a baseline level of smoothing.
  • Mark crossover points: When enabled, plots arrows on the chart at every MAMA/FAMA crossover point.
  • Fill MAMA/FAMA Region: Toggles a colored background fill between the MAMA and FAMA lines to visualize trend strength and direction.
  • Enable Bar colors: When active, paints the chart bars based on the current bullish or bearish trend.

FAQ

What is the difference between MAMA and FAMA?

The MAMA (MESA Adaptive Moving Average) is the primary adaptive line that follows price closely, while the FAMA (Following Adaptive Moving Average) is a more smoothed version calculated from the MAMA, acting as a secondary signal line.

How does the "ekoronin fix" improve the script?

The fix addresses specific phase calculation nuances found in earlier implementations, ensuring the adaptive alpha reacts correctly to cycle changes as described in John Ehlers' original research.

How can I access this indicator?

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.