Rank: Member
Groups: Registered, Registered Users Joined: 2/23/2007(UTC) Posts: 26
|
Dear All,
I am trying to create an exploration with the following rules:
1. The trend can only be up or down.
2. The trend is up when today's close is higher than the highest high of the previous 5 periods.
3. The trend is down when today's close is lower than the lowest low of the previous 5 periods.
I tried something like this:
ColA:Up:- C>((HHV(H,5));
ColB:Down:- C<((LLV(L,5));
Filter: colA or colB
Needless to say, it doesn't work. AAA (Any And All) help appreciated.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 2/23/2007(UTC) Posts: 26
|
Update:
I tried this:
C > Ref(HHV(High,5),-1)
C< Ref(LLV(Low,5),-1)
It seems to work, but is it the correct syntax, correct way, accurate?
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 3 time(s) in 3 post(s)
|
A:=If(C > Ref(HHV(High,5),-1),1,If(C< Ref(LLV(Low,5),-1),-1,0));
A;
this will plot 1 when the c is greater than the Highest 5 Highs and -1 when the low is less than the lowest 5 Lows, else it will plot a 0
A:=If(C > Ref(HHV(High,5),-1),1,If(C< Ref(LLV(Low,5),-1),-1,Prev));
A;
this will plot +1 or -1 till the condition reverses
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 2/23/2007(UTC) Posts: 26
|
Thanks for your help. Will try these and tell you about the results.
|
|
|
|
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.