Multi Adaptive Moving Average (MAMA)
Aug 31, 2024

The Multi Adaptive Moving Average (MAMA) indicator provides a multi-layered trend analysis framework by combining four distinct moving averages with predictive forecasting to anticipate future price direction.
Usage
The Usage section describes how the script can be used to identify trend structure and potential future price paths. Traders can utilize the indicator for the following:
- Trend Confirmation: Observe the alignment of the four moving averages. A bullish alignment occurs when the Short MA is above the Mid, Long, and Very Long MAs. Conversely, a bearish alignment is established when the Short MA is at the bottom of the stack.
- Mean Reversion and Support/Resistance: The various MA lengths (20, 50, 100, 200) act as dynamic levels where price may find support or resistance.
- Predictive Forecasting: The indicator projects the moving averages into the future. If the forecast points upward, it suggests the current momentum is likely to sustain the trend; a flattening or reversing forecast can signal an exhaustion in momentum.
- Crossover Signals: Built-in alerts trigger when the Short MA crosses the Mid MA, or when the Mid MA crosses the Long MA, identifying potential entry or exit points.
Details
The MAMA tool is constructed using a combination of traditional smoothing averages and statistical projection methods.
- Moving Average Calculation: Users can toggle between Simple Moving Averages (SMA) for a smoother, lag-tolerant view, or Exponential Moving Averages (EMA) for faster reactions to recent price volatility.
- Forecasting Logic: The indicator calculates a 5-step projection for each active moving average.
- Flat Forecast: Projects the current price forward, assuming no immediate change in trend slope.
- Linear Regression Forecast: Uses a regression length to calculate the line of best fit, projecting the MA based on existing historical momentum.
- Adaptive Lookback: The indicator can be set to include or exclude the current unclosed candle, allowing traders to avoid "repainting" or lag depending on their preference for real-time data versus confirmed bar closes.
Settings
- Source: Determines the price data used for calculations (e.g., Close, Open, HL2).
- Include current candle: If enabled, the MAMA includes the live candle in its calculations; if disabled, it uses the previous confirmed candle.
- Moving average type: Switches between SMA and EMA for all four lines.
- Forecast type: Selects between 'flat' (price constancy) or 'linreg' (momentum-based projection).
- Linear regression length: Sets the lookback period used specifically for the linear regression forecast calculation.
- Short/Mid/Long/Very Long MA Lengths: Customizes the periods for the four averages (Defaults: 20, 50, 100, 200).
- Color Inputs: Allows customization of the visual styles for each moving average and its associated forecast.
FAQ
How do I interpret the dashed lines at the end of the moving averages? The dashed lines represent the 5-step forecast. They indicate the projected path of the moving average based on the selected forecast mode (Flat or Linear Regression).
Can I use this for intraday scalping? Yes, by adjusting the MA lengths to shorter periods and using the EMA setting, the indicator can be adapted for lower timeframes to capture rapid price shifts.
How can I access the Multi Adaptive Moving Average (MAMA)? 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.