Discussions
 » 
Product and Service Development
 » 
Formula Assistance
 » 
Exploration formula - count of occurrences in X period
 
        
            
            
    
        
Rank: Newbie
  Groups: Registered Users, Subscribers Joined: 10/16/2014(UTC) Posts: 2
  
 
     | 
    
        
            
	      
                Hey guys, 
I have just upgraded to Metastock 13 after some time away from the software. I am wanting to write an exploration formula, where one of the columns will be the percentage of times that the low of the day  is above a MA for the last X periods (say 120 periods). 
I cannot find a 'count' function in the software, does anyone have ideas? 
  
In plain English it would be something like: 
count number of times L > mov(C,20,S) in last 120 days 
divide that figure by 120,  x100 to get the percentage 
  
Thanks for any help! 
Cheers, 
Shane  
            
  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
     | 
        
        
        
            
        
            
            
    
        
Rank: Advanced Member
  Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
  Was thanked: 57 time(s) in 54 post(s)
  
 
     | 
    
        
            
	      
                Hi Shane
Sum( L>Mov(C,20,S), 120)*100/120 should do the trick.
Roy
 
            
  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
     | 
        
        
        
    
        
            
            
    
        
Rank: Newbie
  Groups: Registered Users, Subscribers Joined: 10/16/2014(UTC) Posts: 2
  
 
     | 
    
        
            
	      
                Hi Roy, 
Yes that worked :) 
Thanks for your help, much appreciated! 
Cheers, 
Shane  
            
  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
     | 
        
        
        
    
                           
    
| Users browsing this topic | 
| 
 
Guest (Hidden) 
 | 
Discussions
 » 
Product and Service Development
 » 
Formula Assistance
 » 
Exploration formula - count of occurrences in X period
 
    
        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.