| 
Rank: Advanced Member
 Groups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)
 Posts: 1,999
 
 Thanks: 96 timesWas thanked: 160 time(s) in 155 post(s)
 
 | 
            
	      
                John F. Ehlers' article, “The Deviation-Scaled Moving Average”, introduced a moving average of the same name.  The MetaStock formula for that moving average is provided below.   Deviation-Scaled Moving Average:  Code:tp:= Input("time periods",2, 200, 40);
a1:= Exp(-1.414 * 3.14159 / (tp/2));
b1:= 2*a1 * Cos(1.414*180 /(tp/2));
c2:= b1;
c3:= -a1 * a1;
c1:= 1 - c2 - c3;
zeros:= C-Ref(C,-2);
filt:= c1 * (zeros + Ref(zeros, -1))/2 + c2*PREV + c3*Ref(PREV,-1);
ScaledFilt:= filt/Std(filt,tp);
a2:= Abs(ScaledFilt*5)/tp;
If(Cum(1)<=tp+4, C, a2*C + ((1-a2)*PREV))
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
    
| Users browsing this topic | 
| 
Guest (Hidden) | 
    
        Forum Jump
         
    
    You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.