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
|
|
|
|
Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: gargygargy 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
|
|
|
|
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!
|
|
|
|
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
|
1 user thanked wabbit for this useful post.
|
|
|
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 |
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.