Rank: Member
Groups: Registered, Registered Users Joined: 9/2/2010(UTC) Posts: 11 Location: South Africa
|
I would like to know if there is an alternative to peak and through formula.
Im just looking for higher peaks and higher troughs as an setup for an entry, because using the Peak() and through() function uses the zigzag() formula which isn’t very reliable . Can someone please help me with a formula for higher peaks and higher troughs without using the peak and trough function in metastock?
Thank you
Johan
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
This task maybe gives you an idea how to build such indicator: http://forum.equis.com/forums/thread/33477.aspx
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 9/2/2010(UTC) Posts: 11 Location: South Africa
|
Hi vienna
Thank you for your help but i am new to metastock programming. Can you please explain to me what you mean with this formula from your other post
period1:=10;
period2:=3;
bottomoccured:=LLV(L,period1) AND Ref(Cross(0,LinRegSlope(L,period2)),-(period2-1));
previousbottom:=ValueWhen(1,bottomoccured=1, LLV(L,period1));
belowbottom:=Cross(previousbottom,L);
previousbottom;
belowbottom*LastValue(C);
Thank you for your help
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
Hi Johandk, this formula was for a different indicator but it includes some ideas you can maybe use... period1:=10;
period2:=3;
bottomoccured:=LLV(L,period1) AND
Ref(Cross(0,LinRegSlope(L,period2)),-(period2-1));
gives you a signal if a bottom has occured... With the settings for period1 and period2 you can adjust a little bit what the formula should recognize as a bottom. period1 defines over which period (how many days) a value should be the lowest low value. period2 defines over which period (how many days) the change of the direction should be recognized. previousbottom:=ValueWhen(1,bottomoccured=1, LLV(L,period1));
previousbottom calculates you the last value of the bottom which has occured. Use this formula to play around and change some settings to understand what it is doing. Then you are able to write your own formula which is not for bottoms but for tops. And afterwards you can improve it with your own ideas. There is a lot of room for improving and creativity. best regards vienna
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 3/24/2010(UTC) Posts: 1
|
vienna wrote:Hi Johandk, this formula was for a different indicator but it includes some ideas you can maybe use... period1:=10;
period2:=3;
bottomoccured:=LLV(L,period1) AND
Ref(Cross(0,LinRegSlope(L,period2)),-(period2-1));
gives you a signal if a bottom has occured... With the settings for period1 and period2 you can adjust a little bit what the formula should recognize as a bottom. period1 defines over which period (how many days) a value should be the lowest low value. period2 defines over which period (how many days) the change of the direction should be recognized. previousbottom:=ValueWhen(1,bottomoccured=1, LLV(L,period1));
previousbottom calculates you the last value of the bottom which has occured. Use this formula to play around and change some settings to understand what it is doing. Then you are able to write your own formula which is not for bottoms but for tops. And afterwards you can improve it with your own ideas. There is a lot of room for improving and creativity. best regards vienna
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 9/2/2010(UTC) Posts: 11 Location: South Africa
|
Hi Vienna
I am finally beginning to figure out the formula you wrote, but i am stil confused about the linregslope?
What does the linregslope function do and why do you want it to cross below zero?
Thank you very much
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 12/14/2009(UTC) Posts: 140 Location: Austria
|
Hi Johandk,
the linregslope messures the "slope" / "ascent" of the curve - so if the value for linregslope is positive the line is ascending - if the value is negativ it's decending - if it crosses zero the direction of the curve is changing (from UP to DOWN or from DOWN to UP).
feel free to ask if something is unclear...
|
|
|
|
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.