logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
KTP2  
#1 Posted : Tuesday, May 11, 2010 2:25:30 PM(UTC)
KTP2

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 2/2/2007(UTC)
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Chris Young’s article, “The Average Peak Excursion,” includes three formulas for calculating the rate of return. Theses formulas are listed below as indicators.

To enter these indicators into MetaStock:

  1. In the Tools menu, select Indicator Builder.
  2. Click New to open the Indicator Editor for a new indicator.
  3. Type the name of the formula.
  4. Click in the larger window and type in the formula.
  5. Click Ok to close the Indicator Editor.

    Name: Average Peak Excursion
    Formula:
    x:=Input("number of periods for APE",1,200,1);
    Max( Abs(HHV(H, x) - Ref(O, -(x-1))), Abs(LLV(L, x) - Ref(O, -(x-1))) )

    Name: APE ratio
    Formula:
    x:=Input("number of periods for APE ratio",2,200,25);
    ax:= Max( Abs(HHV(H, x) - Ref(O, -(x-1))), Abs(LLV(L, x) - Ref(O, -(x-1))) );
    a1:= Max( Abs(H - O), Abs(L - O) );
    ax / a1

    Name: APE Alpha
    Formula:
    x:=Input("number of periods for APE",2,200,25);
    ax:= Max( Abs(HHV(H, x) - Ref(O, -(x-1))), Abs(LLV(L, x) - Ref(O, -(x-1))) );
    a1:= Max( Abs(H - O), Abs(L - O) );
    Log( ax / a1 ) / Log( x )

These formulas can also be used in explorations, but the first line will need to be changed first. The Input() function only works in indicators. For the explorations replace this line:

    x:=Input("number of periods for APE",2,200,25);

with this line:

    x:= 25;

The number typed in after x is the number of periods used for the long term APE calculation and can be any value desired.

William Golson
Equis International

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.