Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
... and in the same context...
You have coded the rally, reaction, inside and outside days, but what about those occassions of which you have already queried? What about those days that arent one of those days coded?
Test for them using code like, to find uncategorised days:
dRally OR dReaction OR dOutside OR dInside
Now in your case, every day fits into one of these four categories.... but you might consider that you need to create another category to deal with the days of you problem.
wabbit :D
P.S. I have modified your code and variables a bit to ease my readability. Perhaps you might find these variable names a little easier to use. When the code works well, you can replace the long variable names with short one to save space - but only do that when the code is working perfectly!
H1:=Ref(H,-1);
L1:=Ref(L,-1);
dRally:=H>H1 AND L>=L1;
dReaction:=H<=H1 AND L<L1;
dOutside:=H>H1 AND L<L1;
dInside:=dRally+dReaction+dOutside=0;
{consider adding more categories in here}
E0:=If(dInside OR Inside(),PREV,
If(dOutside AND PREV>Ref(MP(),-1),H,
If(dOutside AND PREV<Ref(MP(),-1),L,
If(dReaction,L,If(dRally,H,PREV)))));
F0:=If(MP()<E0,
HighestSince(1,MP()>E0,H),
LowestSince(1,MP()<E0,L));
SW:=Zig(F0,0.0001,%);
SW;
|