Traders' Tips from TASC Magazine

Breakout_Range2

The MetaStock code for the Breakout_Range2, by Mark Vakkur, M.D. is as follows:

For the Custom Indicator
To create the custom indicator select Indicator Builder from the Tools menu, click New and enter the following code:

Name: Breakout_Range2
Formula:
     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 System
To create the system, select System Tester from the Tools menu, click New and enter the following code:

Name: Breakout_Range2 System
Enter 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.


Contents