# MAMA - Mesa Adaptive Moving Average

#### Description <a href="#description_65" id="description_65"></a>

This automatically adapting moving average has a period length that is determined by means of various complex calculations. This complex indicator has its origins in publications by John Ehlers. Ehlers calculates cycles for the price movements to determine the length and intensity of single trend phases. Working with the length of the cycles, the weighting factor for the moving average can be established in several different ways.

**FAMA** This indicator is a second line – the name FAMA can be found in various publications. This line is similar to the underlying exponential moving average and can be used as a trigger line.

#### Interpretation <a href="#interpretation_34" id="interpretation_34"></a>

For more concise information, we recommend that you read Ehler’s paper.

General information about moving averages can be found here: [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Further information <a href="#further-information_25" id="further-information_25"></a>

<http://www.tradesignalonline.com/de/lexicon/view.aspx?id=MAMA+adaptive+Moving+Average>

#### Usage <a href="#usage_66" id="usage_66"></a>

```csharp
MAMA(double fastLimit, double slowLimit)
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit)
MAMA(double fastLimit, double slowLimit)[int barsAgo]
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit)[int barsAgo]

//Value of the Following Adaptive Moving Average (FAMA)
MAMA(double fastLimit, double slowLimit).Fama[int barsAgo]
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit).Fama[int barsAgo]
```

#### Return value <a href="#return-value_63" id="return-value_63"></a>

**double**

When using this method with an index (e.g. **MAMA**(0.5,0.05)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_56" id="parameters_56"></a>

inSeries Input data series for the indicator

fastLimit Upper limit for the alpha value

slowLimit Lower limit for the alpha value

#### Visualization <a href="#visualization_60" id="visualization_60"></a>

![MAMA - Mesa Adaptive Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/MAMA.jpg)

#### Example <a href="#example_62" id="example_62"></a>

```csharp
//Output values for (MAMA)
Print("The current value for the MAMA is " + MAMA(0.5, 0.05)[0]);
//Output values for (FAMA)
Print("The current value for the FAMA is " + MAMA(0.5, 0.05).Fama[0]);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://indicators.agenatrader.com/standard-indicators/moving-averages/mama-mesa-adaptive-moving-average.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
