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

Notification

Icon
Error

Options
Go to last post Go to first unread
gargygargy  
#1 Posted : Saturday, April 30, 2022 3:36:25 PM(UTC)
gargygargy

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 11/20/2020(UTC)
Posts: 1

Hello,

I'm looking to create a formula that recognizes if the stock is in consolidation.

The consolidation length may be from 2 months to 36 months, and the difference between the low level of the consolidation and the high level of the consolidation should be maximum 20%. The price should be withing the consolidation range no less than 80% of the time.

Is there a way to do it?

Thank you

MS Support  
#2 Posted : Monday, May 2, 2022 4:08:59 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,929

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)
Originally Posted by: gargygargy Go to Quoted Post

Hello,

I'm looking to create a formula that recognizes if the stock is in consolidation.

The consolidation length may be from 2 months to 36 months, and the difference between the low level of the consolidation and the high level of the consolidation should be maximum 20%. The price should be withing the consolidation range no less than 80% of the time.

Is there a way to do it?

Thank you

Hello,

I believe this should be possible. You can try the following formula to see if it meets your criteria. If not, and you don't get any other responses here you may wish to try our formulas team to see if they can help via https://www.metastock.com/customer/resources/formulas/customformulaform.aspx

The following formula allows you to input a consolidation length (using a Daily data range of 60 periods to 1080 periods to estimate 2 to 36 months, you could lower these values if you only want to consider trading days). It then compares the Low price to the Highest High Value of the High price over this consolidation length looking for the Low price to be within 20% of the High. It then Sums up this conditional criteria, looking for the condition to be true at least 80% of the time.

Code:
X:=Input("Enter Consolidation Length",60,1080,60);
Y:=L / HHV(H,X) >= 0.8;
Sum(Y,X) / X >= 0.8

Edited by user Monday, May 2, 2022 4:14:32 PM(UTC)  | Reason: Not specified

Anne Austin  
#3 Posted : Saturday, September 17, 2022 11:11:15 AM(UTC)
Anne Austin

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/15/2022(UTC)
Posts: 6
Location: Perth

hi, i tried exactly writing the above consolidation formula into the filter section of explorer but I got the message “ this function is not allowed in this type of formula”. What did I do wrong? I have version 15 of metastock. the phrase “Enter consolidation Length” does seem rather odd…am I supposed to insert a real value here or something? i am a real metastock novice!
wabbit  
#4 Posted : Sunday, September 18, 2022 6:23:40 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Explorations cannot use the Input() function, so you have to assign a value in code
Code:
 X:=60;
Y:=L / HHV(H,X) >= 0.8;
Sum(Y,X) / X >= 0.8
wabbit :D
thanks 1 user thanked wabbit for this useful post.
MS Support on 9/19/2022(UTC)
Anne Austin  
#5 Posted : Sunday, September 18, 2022 12:36:00 PM(UTC)
Anne Austin

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/15/2022(UTC)
Posts: 6
Location: Perth

Thank you, wabbit. metastock explorer liked that one!
Users browsing this topic
Similar Topics
Consolidation Formula (Formula Assistance)
by sisenberg 3/9/2017 5:52:14 PM(UTC)
Consolidation zone indicator (Formula Assistance)
by TraderWeb 2/2/2012 5:35:24 PM(UTC)
consolidation detector (Formula Assistance)
by garp 11/1/2009 7:37:43 AM(UTC)
Consolidation Breakout (Advanced Coding Techniques)
by adl 6/12/2006 9:26:13 AM(UTC)
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.