# Mmovavg

Mmovavg-func

## Description

This function is for calculating modified moving averages. Average value at the starting point = n is calculated by Movavg function, and then other points are calculated by formula similar to Emovavg function with weighting factor .

where is the nth point calculated by movavg(x, n-1,0).

## Syntax

vector mmovavg(vector vd, int n)

## Parameters

**vd**

- The data vector used to calculate modified moving average.

**n**

- is the timeperiod.

## Return

Return the modified moving average vector.

## Example

// Col(2) will be filled with modified moving average value at each point, with stating point = 10.
for(ii=1;ii<=30;ii++) col(1)[ii] = ii;
col(2)=mmovavg(col(1),10);