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));
End;
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»);