Rank: Member
Groups: Registered, Registered Users Joined: 6/22/2005(UTC) Posts: 29 Location: Singapore
|
Thanks, Patrick. Your code works! Way to go, learning every single day.
I came up with another way to code it.
C1:=(O<=Ref(H,-1) AND O>=Ref(C,-1));
C2:=Cum(If(C1,Fml("Open-Close"),0));
C2
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Your way is much better :wink:
Glad you got what you wanted :D
|
|
|
|
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)
|
B:=If(O-C<0,C-O,0);
C1:=(O<=Ref(H,-1) AND O>=Ref(C,-1));
C2:=Cum(If(C1,B,0));
C2
will give the sum of + closes above the open when your condition is true
your version will give the total of O-C when your condition is true ,
O-C on a day where the C>O will give a - number
O-C on a day where the C<O will give a + number
|
|
|
|
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.