Discussions
»
Product and Service Development
»
Formula Assistance
»
How to use SUM to count days that different greater than X%
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/1/2013(UTC) Posts: 2
|
Suppose I have the following formula
x:= 1.05; { parameter - different % } sumdays:= Ref(C, -1)/C > x + Ref(C, -2)/C > x + Ref(C, -3)/C > x + ...
I know it should able to be replace with SUM but I could not figure out how to use current bar's C in SUM formula
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
you are misusing the Sum Function() try the Cum() Function instead X:=1.05; Cum(Ref(C,-1)/C >X);
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 5/1/2013(UTC) Posts: 2
|
Let me explain my request in more details.
I would like to count backward for T day which has percentage change greater than X compared with current bar.
For example: Let T = 5 days. X = 1.05 My indicator on May/3 will counts day in Apr/29 - May/3 range if C on that day is greater than C on May/3 by 5% (yeah, it will never count on May/3 which is fine. I will look to correct it later on)
so, 1) I think it should be SUM since I want a count on fixed interval 2) I think Sum/Cum(Ref(C,-1)/C >X); does compare adjacent bars instead pf what I need.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
Sum("data array","number of times to add up") IE : Sum(C,5) equals the close of the last 5 days totaled IE:Sum(C>Ref(C,-1),5) will give you the number of times the close is greater than yesterday for the past 5 days
Cum("data array") is the total number of times an event occurs
You may also want to look at the price rate of change indicator
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
How to use SUM to count days that different greater than X%
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.