Rank: Newbie
Groups: Registered Users, Subscribers Joined: 7/3/2015(UTC) Posts: 1
|
How to find out no. of bar since the 3rd most recent occurrence of H>BBandTop(C,20,S,2)
I tried below formula but not work:
BarsSince( (ValueWhen(3,H>BBandTop(C,20,S,2),H-L)>0) )
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi ALICE
I've created two possible solutions to your problem. However your request is a little vague as to detail. The first piece of code counts bars since the third most recent H>BBandTop, which also includes subsequent bars where H remains > BBandTop). The second piece of code counts only the crossovers, and not the secondary bars where H remains higher than BBandTop.
If this doesn't help then please provide a more detailed description for helpers to work with. That saves us having to guess what your exact intention is.
Roy
{Barssince 3rd most recent "H > BBTop"}
A:=H>BBandTop(C,20,S,2);
B:=Cum(A);
D:=B+2=LastValue(B);
F:=BarsSince(D*Alert(D=0,2));
LastValue(F);
{Barssince 3rd most recent "H cross over BBTop"}
A:=Cross(H,BBandTop(C,20,S,2));
B:=Cum(A);
D:=B+2=LastValue(B);
F:=BarsSince(D*Alert(D=0,2));
LastValue(F);
|
1 user thanked mstt for this useful post.
|
|
|
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.