Lean  $LEAN_TAG$
QuantConnect.Indicators.MesaAdaptiveMovingAverage Class Reference

Implements the Mesa Adaptive Moving Average (MAMA) indicator along with the following FAMA (Following Adaptive Moving Average) as a secondary indicator. The MAMA adjusts its smoothing factor based on the market's volatility, making it more adaptive than a simple moving average. More...

Inheritance diagram for QuantConnect.Indicators.MesaAdaptiveMovingAverage:
[legend]

Public Member Functions

 MesaAdaptiveMovingAverage (string name, decimal fastLimit=0.5m, decimal slowLimit=0.05m)
 Initializes a new instance of the MesaAdaptiveMovingAverage class. More...
 
 MesaAdaptiveMovingAverage (decimal fastLimit=0.5m, decimal slowLimit=0.05m)
 Initializes a new instance of the MesaAdaptiveMovingAverage class with default name ("MAMA") and the specified fast and slow limits for the adaptive moving average calculation. More...
 
override void Reset ()
 Resets the indicator's state, clearing history and resetting internal values. More...
 

Public Attributes

override bool IsReady => Samples >= WarmUpPeriod
 Returns whether the indicator has enough data to be used (ready to calculate values). More...
 
int WarmUpPeriod => 33
 Gets the number of periods required for warming up the indicator. 33 periods are sufficient for the MAMA to provide stable and accurate results, More...
 

Protected Member Functions

override decimal ComputeNextValue (IBaseDataBar input)
 Computes the next value for the Mesa Adaptive Moving Average (MAMA). It calculates the MAMA by applying a series of steps including smoothing, detrending, and phase adjustments. More...
 
- Protected Member Functions inherited from QuantConnect.Indicators.BarIndicator
 BarIndicator (string name)
 Creates a new TradeBarIndicator with the specified name More...
 

Properties

IndicatorBase< IndicatorDataPointFama [get]
 Gets the FAMA (Following Adaptive Moving Average) indicator value. More...
 
- Properties inherited from QuantConnect.Indicators.IIndicatorWarmUpPeriodProvider
int WarmUpPeriod [get]
 Required period, in data points, for the indicator to be ready and fully initialized. More...
 

Detailed Description

Implements the Mesa Adaptive Moving Average (MAMA) indicator along with the following FAMA (Following Adaptive Moving Average) as a secondary indicator. The MAMA adjusts its smoothing factor based on the market's volatility, making it more adaptive than a simple moving average.

Definition at line 25 of file MesaAdaptiveMovingAverage.cs.

Constructor & Destructor Documentation

◆ MesaAdaptiveMovingAverage() [1/2]

QuantConnect.Indicators.MesaAdaptiveMovingAverage.MesaAdaptiveMovingAverage ( string  name,
decimal  fastLimit = 0.5m,
decimal  slowLimit = 0.05m 
)

Initializes a new instance of the MesaAdaptiveMovingAverage class.

Parameters
nameThe name of the indicator.
fastLimitThe fast limit for the adaptive moving average (default is 0.5).
slowLimitThe slow limit for the adaptive moving average (default is 0.05).

Definition at line 74 of file MesaAdaptiveMovingAverage.cs.

◆ MesaAdaptiveMovingAverage() [2/2]

QuantConnect.Indicators.MesaAdaptiveMovingAverage.MesaAdaptiveMovingAverage ( decimal  fastLimit = 0.5m,
decimal  slowLimit = 0.05m 
)

Initializes a new instance of the MesaAdaptiveMovingAverage class with default name ("MAMA") and the specified fast and slow limits for the adaptive moving average calculation.

Parameters
fastLimitThe fast limit for the adaptive moving average (default is 0.5).
slowLimitThe slow limit for the adaptive moving average (default is 0.05).

Definition at line 101 of file MesaAdaptiveMovingAverage.cs.

Member Function Documentation

◆ ComputeNextValue()

override decimal QuantConnect.Indicators.MesaAdaptiveMovingAverage.ComputeNextValue ( IBaseDataBar  input)
protected

Computes the next value for the Mesa Adaptive Moving Average (MAMA). It calculates the MAMA by applying a series of steps including smoothing, detrending, and phase adjustments.

Parameters
inputThe input bar (price data).
Returns
The calculated MAMA value.

Definition at line 124 of file MesaAdaptiveMovingAverage.cs.

◆ Reset()

override void QuantConnect.Indicators.MesaAdaptiveMovingAverage.Reset ( )

Resets the indicator's state, clearing history and resetting internal values.

Definition at line 264 of file MesaAdaptiveMovingAverage.cs.

Member Data Documentation

◆ IsReady

override bool QuantConnect.Indicators.MesaAdaptiveMovingAverage.IsReady => Samples >= WarmUpPeriod

Returns whether the indicator has enough data to be used (ready to calculate values).

Definition at line 110 of file MesaAdaptiveMovingAverage.cs.

◆ WarmUpPeriod

int QuantConnect.Indicators.MesaAdaptiveMovingAverage.WarmUpPeriod => 33

Gets the number of periods required for warming up the indicator. 33 periods are sufficient for the MAMA to provide stable and accurate results,

Definition at line 116 of file MesaAdaptiveMovingAverage.cs.

Property Documentation

◆ Fama

IndicatorBase<IndicatorDataPoint> QuantConnect.Indicators.MesaAdaptiveMovingAverage.Fama
get

Gets the FAMA (Following Adaptive Moving Average) indicator value.

Definition at line 66 of file MesaAdaptiveMovingAverage.cs.


The documentation for this class was generated from the following file: