Click or drag to resize

Modified Moving Average

Modified Moving Average (Mma) is another way of calculating the average values for a series. It is applied in indicators, for example in Atr.

Market Signals

Modified moving average gives signals same way like any moving average – if price crosses from above, it is buy signal, if from below, it is a sell signal.

Calculation

Modified Moving Average 001

Chart Example

Modified Moving Average 002

Implementation and Usage

To initialize Mma use one of the following constructors:

Mma – sets default values: period = 14

Mma(Int32) – sets value for period

Use

MMA - property to get current value

Example
C#
 1// Create new instance
 2Mma mma = new Mma(28);
 3
 4// Number of stored values
 5mma.HistoryCapacity = 2;
 6
 7// Add new data point
 8mma.Add(CurrentPrice);
 9
10// Get indicator value
11double IndicatorValue = mma.MMA;
12// Get previous value
13if (mma.HistoryCount == 2)
14{
15    double IndicatorPrevValue = mma[1];
16}