Skip to content

Indicator Description ​

MAMA (MESA Adaptive Moving Average) is an adaptive moving average that automatically adjusts its smoothing level according to market volatility, providing both fast and slow moving averages.

Function Information ​

  • Function Name: MAMA
  • Input Parameters:
    • #Kline: K-line data
  • Parameter Settings:
    • fastlimit: Fast limit (default: 0.5)
    • slowlimit: Slow limit (default: 0.05)
  • Output:
    • mama: Adaptive moving average
    • fama: Fast adaptive moving average

Calculation Principle ​

MAMA is calculated using the following formula:

alpha = 2 * (fastlimit - slowlimit) / (1 + fastlimit)
mama = alpha * price + (1 - alpha) * mama[1]
fama = 0.5 * alpha * mama + (1 - 0.5 * alpha) * fama[1]

Where:

  • alpha is the adaptive coefficient
  • price is the current price
  • mama[1] is the MAMA value of the previous period
  • fama[1] is the FAMA value of the previous period

Usage Scenarios ​

  1. Trend identification and tracking
  2. Market volatility analysis
  3. Trading signal generation
  4. Support and resistance level judgment