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

Notification

Icon
Error

Options
Go to last post Go to first unread
dimpledbrain  
#1 Posted : Monday, May 23, 2022 12:47:23 AM(UTC)
dimpledbrain

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/7/2013(UTC)
Posts: 17

Thanks: 5 times

hi all,

need some quick guide to help on the above, basically where i want to say Line A is above/below Line B for x number of days in a row.

Initially i thought of highest high value/ LLV, max, min, but it seems like it is just taking 1 point on Line A to compare with 1 point on Line B

Alternatively i could write it repeatedly as follows:

mov(c,5,%)>mov(c,25,%)

mov(ref(c-1),5,%)>mov(ref(c-1,5),25,%)

mov(ref(c-2),5,%)>mov(ref(c-2,5),25,%)

mov(ref(c-3),5,%)>mov(ref(c-3,5),25,%)

and so on....

Any idea how to shorten the above. What is the formula language to use? Scanned through the user manual but couldnt locate it

Thank you. 

MS Support  
#2 Posted : Monday, May 23, 2022 4:31:01 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: dimpledbrain Go to Quoted Post

hi all,

need some quick guide to help on the above, basically where i want to say Line A is above/below Line B for x number of days in a row.

Initially i thought of highest high value/ LLV, max, min, but it seems like it is just taking 1 point on Line A to compare with 1 point on Line B

Alternatively i could write it repeatedly as follows:

mov(c,5,%)>mov(c,25,%)

mov(ref(c-1),5,%)>mov(ref(c-1,5),25,%)

mov(ref(c-2),5,%)>mov(ref(c-2,5),25,%)

mov(ref(c-3),5,%)>mov(ref(c-3,5),25,%)

and so on....

Any idea how to shorten the above. What is the formula language to use? Scanned through the user manual but couldnt locate it

Thank you. 

Hi,

You might want to see if the Sum function fits your needs in this respect.

If you wrap Sum around a conditional statement it will return the number of times that condition was true over X periods. You can also make the Sum a conditional statement by requiring that the result has to equal the X periods value. For example:

Code:
X:=4;
Sum(Mov(C,5,E)>Mov(C,25,E),X)=X

You don't have to use a Variable of course, although this can make it easier to Edit the formula for different values, and you could also use it with the Input function to make the indicator more customizable without having to Edit the formula every time.

Code:
X:=Input("True Periods for Condition",1,999,4);
Sum(Mov(C,5,E)>Mov(C,25,E),X)=X

thanks 1 user thanked MS Support for this useful post.
dimpledbrain on 5/24/2022(UTC)
Users browsing this topic
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.