Разместил:   Дата: 2006-01-15 06:47
Комментарии: (0)   Рейтинг:

In Traders' Tips this month, we look at the article in this issue by Joe Sharp, "More Responsive Moving Averages." The article describes a modified moving average that greatly diminishes the lag that is typically associated with moving averages. With the formula described in the article, the moving average line is more responsive to changes in the price action.

An indicator to plot the modified moving average can be easily created for application on a chart. In the EasyLanguage below, the calculation for the modified moving average is created in an EasyLanguage function called ModifiedMA. This function basically takes care of all the necessary calculations for the modified moving average line. By putting the entire calculation into a function, the modified moving average calculation can be easily referenced by any analysis technique. Once the modified moving average (ModifiedMA) function has been created, an analysis technique to plot the function value is also very easy to create.

Below is the EasyLanguage that is used to create both the function and indicator for the modified moving average. The EasyLanguage would be entered in the EasyLanguage PowerEditor as displayed here:

Type: Function, Name: ModifiedMA

Inputs: Price(Numeric), Length(Numeric);
Variables: Factor(0), Slope(0), SMA(0), MMA(0);

Slope = 0;

For value1 = 1 To Length Begin
Factor = 1 + (2 * (value1 - 1));
Slope = Slope + (Price[value1 - 1] * ((Length - Factor)/2));

SMA = Average(Price, Length);
MMA = SMA + (6 * Slope) / ((Length + 1) * Length);

ModifiedMA = MMA;

Type: Indicator, Name: Modified Mov Avg

Inputs: Price(Close), Length(2);

Plot1(ModifiedMA(Price, Length), "MMA");


Rambler's Top100

Страница создана за 0.045 секунды