MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

Modified Moving Average by Joe Sharp
To recreate in MetaStock 6.52 or higher the modifiedmoving average as explained by Joe Sharp in "More Responsive Moving Averages" elsewherein this issue, select "Indicator Builder" from the Tools menu, click "New" and enter the following code, accordingto the desired period:

Modified Moving Average for a two-period average

N:=2;
TN:=Mov(C,N,S);
s1:=((n-1)/2)*C+((n-3)/2)*Ref(C,-1);
y2:=TN+(6*S1)/((n+1)*n);
y2

Modified Moving Average for a three-period average

N:=3;
TN:=Mov(C,N,S);
s1:=((n-1)/2)*C+((n-3)/2)*Ref(C,-1)+((n-5)/2)*Ref(C,-2);
y2:=TN+(6*S1)/((n+1)*n);
y2

Modified Moving Average for a four-period average

N:=4;
TN:=Mov(C,N,S);
s1:=((n-1)/2)*C+((n-3)/2)*Ref(C,-1)+((n-5)/2)*Ref(C,-2)+((n-7)/2)*Ref(C,-3);
y2:=TN+(6*S1)/((n+1)*n);
y2

Modified Moving Average for a 10-period average

N:=10;
TN:=Mov(C,N,S);
s1:=((n-1)/2)*C+((n-3)/2)*Ref(C,-1)+((n-5)/2)*Ref(C,-2)+((n-7)/2)*Ref(C,-3)
+((n-9)/2)*Ref(C,-4)+((n-11)/2)*Ref(C,-5)+((n-13)/2)*Ref(C,-6)
+((n-15)/2)*Ref(C,-7)+((n-17)/2)*Ref(C,-8)+((n-19)/2)*Ref(C,-9);
y2:=TN+(6*S1)/((n+1)*n);
y2

Cheryl Elton
Equis International
Source / From: TOP