Rank: Newbie
Groups: Registered, Registered Users Joined: 12/26/2013(UTC) Posts: 2
|
How do I write a formula that allows me to count the number of times in a row a condition has passed. Cum(If(Fml("ROC total system buy")=1,1,0)) this is what I came up with but it does not reset to zero once the condition no longer passes.
I read a post on count but can not get the syntax right to get the formula to work.
Cum(If(Fml("ROC total system buy")=1,1,0)
start:= fml("ROC total system buy")=1
stop:= fml("ROC total system buy")=0
count:= if(prev=0, if(start, 1, 0), if(stop, 0, prev)) count So what I want in english is a line that moves up one for every time the FML is true, but once it is false the count resets to zero and will not move up again until the FML is true again.
Thanks Mark
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 7/12/2007(UTC) Posts: 134 Location: Perth Western Australia
|
Below is an example of one of a number of ways to code what you are chasing.
Buy:=Fml("ROC total system buy"); Event:=Buy; Count:=Cum(Event); Reset:=Buy=0 AND Alert(Buy<>0,2); Counter:=Count-ValueWhen(1,Reset,Count); Counter
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/26/2013(UTC) Posts: 2
|
Dr Oz Thanks very much that worked perfectly.
|
|
|
|
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.