Discussions
»
Product and Service Development
»
Formula Assistance
»
Filtering out historical tops and bottoms ? (also forward-looking data)
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/4/2006(UTC) Posts: 57 Location: Zurich, Switzerland
|
I have Excel functions to filter out tops and bottoms automatically:
=IF(MAX(D22:D40,D42:D61)-D41>0,0,D41) =IF(MIN(E22:E40,E42:E61)-E41<0,0,E41)
I would like to code something like this in Metastock, but I would like to possibly adjust the days before and after the day which is being looked at as a parameter, if ever possible.
I know this is using forward-looking information, but is is to be used for validation, and not for trading purposes.
So what I want to do is to see wether each day has been the lowest price for the n days following and the n days preceding.
How could that be coded?
The goal is to have an indicator displaying a "1" when the current Low is the lowest for n days before AND after the current day, and to display a "1" when the current high is the highest for n days before AND after the current day.
Any hints? Thanks in advance.
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 12/19/2006(UTC) Posts: 3
|
This should be a start in the right direction....
----------------------------------------------------------------
N:= 5;
H1:= Ref(H,-N) = HHV(H,2*N+1);
H2:= Ref(H1,N) ;
H2;
L1:= Ref(L,-N) = LLV(L,2*N+1);
L2:= Ref(L1,N) ;
L2;
----------------------------------------------------------------
Regards,
Crash
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/4/2006(UTC) Posts: 57 Location: Zurich, Switzerland
|
in fact, a very good start! thank you so much!
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
Formula Assistance
»
Filtering out historical tops and bottoms ? (also forward-looking data)
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.