Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 2/2/2007(UTC) Posts: 367
Was thanked: 1 time(s) in 1 post(s)
|
To create the Modified Moving Average, as explained in the article "Quicken Your Averages" by Joe Sharp, in MetaStock 6.52 or higher, select Indicator Builder from the Tools menu, click New and enter the following code, according to the desired period.
Name: Modified Moving Average
For a 2 period average/p>
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
For a 3 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
For a 4 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
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
|