Discussions
 » 
Product and Service Development
 » 
Formula Assistance
 » 
help for simple formula for price touching the moving average.
 
        
            
            
    | 
Rank: Newbie
 Groups: Registered, Registered UsersJoined: 3/4/2009(UTC)
 Posts: 1
 
 | 
            
	      
                pals,i m quite new to using metastock, i need help for coding a formula
 
 formula when price touches the exponential moving average
 say price touches a 20 day ema
 or price touches a 60 dat ena,
 
 i may be sounding like a ass but plz help me, i really need this
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered Users, Subscribers, Unverified UsersJoined: 10/28/2004(UTC)
 Posts: 3,112
 Location: Perth, Western Australia
 
 Was thanked: 17 time(s) in 17 post(s)
 | 
            
	      
                Hi mohitdawar,
 Welcome to the forum.
 
 The purpose of the forum is to assist people who are having trouble doing their own work in MS. Have a thorough read of the MS Users Manual and download the free Equis Formula Primer from the files section. These will give you the basics for writing your on MS functions, experts and explorations. Should you get stuck, you can always post your best attempt at the code on the forum, along with a full explanation of what you are trying to achieve and why your code is not achieving this, and someone will come to your aid.
 
 There are also many, many posts containing codes which could already solve your problem. Do a search of the forum and see what comes up. Even if you don't find the exact answer, you might find something that's pretty close and can be edited to fulfil your specific requirements.
 
 
 Hope this helps.
 
 wabbit [:D]
 
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered UsersJoined: 11/7/2005(UTC)
 Posts: 602
 
 | 
            
	      
                 By touch I guess you don't mean cross so a touch would be something like:
 
 a1:=mov(C,20,E);
 a2:=If((L<a1) and (H>a1) and (C>a1),1,0);
 a3:=If((Ref(L,-1)>Ref(a1,-1)),1,0);
 a2*a3
 
 
 
 | 
    | 
             | 
            
         | 
    |  | 
        
        
        
            
        
            
            
    | 
Rank: Advanced Member
 Groups: Registered, Registered UsersJoined: 8/13/2005(UTC)
 Posts: 170
 
 Thanks: 7 times
 | 
            
	      
                a2:=If((L<a1) and (H>a1) and (C>a1),1,0); Just add '=' also,
 a2:= If((L<= a1) and (H>= a1) and (C>a1),1,0); | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
    
| Users browsing this topic | 
| 
Guest (Hidden) | 
Discussions
 » 
Product and Service Development
 » 
Formula Assistance
 » 
help for simple formula for price touching the moving average.
 
    
        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.