| 
Rank: Advanced Member
 Groups: Registered, Registered Users, SubscribersJoined: 2/2/2007(UTC)
 Posts: 367
 
 Was thanked: 1 time(s) in 1 post(s)
 | 
            
	      
                The MetaStock code for the Breakout_Range2, by Mark Vakkur, M.D. is as follows: For the Custom IndicatorTo create the custom indicator select Indicator Builder from the Tools menu, click New and enter the following code:
 Name: Breakout_Range2Formula:
 lb:=4; { number of periods in look back }
 event:=H > HHV(Ref(H,-1),lb);
      If(event AND (Ref(BarsSince(event),-1)>=lb), Ref(BarsSince(event),-1), 0 ) For the SystemTo create the system, select System Tester from the Tools menu, click New and enter the following code:
 Name: Breakout_Range2 SystemEnter Long:
 lb:=OPT1; { number of periods in look back }
 event:=H > HHV(Ref(H,-1),lb);
      If(event AND (Ref(BarsSince(event),-1)>=lb),1, 0 ) Stops:Inactivity:
 Positions: Longs
 Method: Percent
 Minimum Change: 10000
 Periods: OPT1
 Optimization:Name: OPT1
 Minimum: 2
 Maximum: 20
 Step: 1
 Note: to remove the optimization replace OPT1 in the formula and in the Inactivity stop with your desired look back period. | 
    | 
             | 
            
         | 
    |  | 
        
        
        
    
                           
    
| 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.