An independent plugin for AmiBroker · built for serious traders Documentation & support →

MESA Adaptive Moving Average (MAMA)

John Ehlers' MAMA — a moving average that adapts to the measured market cycle.

MESA Adaptive Moving Average (MAMA)

Every moving average is a compromise. A short one reacts quickly but whipsaws; a long one is smooth but lags badly and gives signals late. MAMA — the MESA Adaptive Moving Average, published by John Ehlers in Stocks & Commodities in 2001 — sidesteps that compromise by changing its own speed. It speeds up and slows down automatically based on how fast the market's phase is changing, measured with Ehlers' homodyne discriminator. The result is a fast-attack, slow-decay average: it ratchets quickly to follow a real move, then holds steady until the next one, so it stays close to price in a trend while filtering out the chop.

How the Toolbox does it

The indicator produces two lines: MAMA itself and a companion called FAMA (Following Adaptive Moving Average), which adapts at half the speed. Because FAMA reacts more slowly, the two behave like a fast/slow moving-average pair, and the crossover between them is the classic signal — similar in spirit to a MACD crossover, but with far less lag and far fewer false turns. The Toolbox ships it as a ready-made chart that plots both lines and marks a buy where MAMA crosses above FAMA and a sell where it crosses below; the same formula runs as an Exploration to scan a watchlist for the latest crossover.

How you would use it

Use it as a trend filter or a crossover system. Two parameters bound its adaptive speed:

  • Fast limit — the fastest smoothing it may use. Raising it makes MAMA hug price more tightly. A typical value is 0.5.
  • Slow limit — the floor on its speed. Lowering it makes the line sit flatter during quiet periods. A typical value is 0.05.

The 0.5 / 0.05 pair is Ehlers' published starting point.