MamaBase (Function)
The MamaBase series function calculates and returns values for MAMA (Mesa Adaptive Moving Average) and FAMA (Following Adaptive Moving Average) based on a exponential moving average.
This function features a "fast attack average and a slow decay average so that composite average rapidly ratchets behind price changes and holds the average value until the next ratchet occurs"1.
Syntax
MamaBase(Price,FastLimit,SlowLimit,FAMAMult,oMAMA,oFAMA)
Returns (Double)
The oMAMA and oFAMA output parameters contain the calculated MAMA and FAMA values. The MamaBase function itself returns 1.
Parameters
| Name | Type | Description |
| Price | NumericSeries | Specifies which bar value (price, function, or formula) to consider. |
| FastLimit | Numeric | Sets the maximum allowable value for calculation of the alpha value for smoothing. |
| SlowLimit | Numeric | Sets the minimum allowable value for calculation of the alpha value for smoothing. |
| FAMAMult | Numeric | Sets the multiplier for FAMA calculation to provide for additional smoothing. |
| oMAMA | NumericRef | Outputs the calculated MAMA value by reference. |
| oFAMA | NumericRef | Outputs the calculated FAMA value by reference. |
Remarks
See Multiple Output Function for more information on using output parameters to return values.
Reference
1John F. Ehlers, MESA Adaptive Moving Averages. Technical Analysis of Stocks & Commodities, V. 19:9 (30-35).