Discussions
»
Product and Service Development
»
MetaStock
»
Newie needs help with 3 inside days [RESOLVED]
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 3/18/2006(UTC) Posts: 10
|
I have just started trying to create exploration formulas and need help with what appears to be very simple except I am not getting it. Here is my formula;
Inside()
Inside()-1
Inside()-2
I have copied this from a formula page but when I paste it Metastock is expecting an operator. What column should I be pasting it in and what operators should I use? Thank you for your patience
[RESOLVED].
|
|
|
|
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)
|
Candlestix,
There has been much discussion before on EXACTLY what defines an inside day.
You could use the built-in MS Inside() indiactor, but that could lead to some confusion, so I think it is better to long-way-around-hard-code your own indicator... just to be on the safe side.
Lets say, for an INSIDE day to occur, the high must be LESS than the previous day high, and the low must be MORE than the previous day low, i.e.
myInside:=H<(Ref(H,-1) AND L>Ref(L,-1);
Now you want three of these in a row, so we sum the indicator over the last three bars, i.e
Sum(myInside,3)=3;
Put it all together:
--8<----------------------------
myInside:=H<(Ref(H,-1) AND L>Ref(L,-1);
Sum(myInside,3)=3;
--8<----------------------------
NOTE: If you think Inside days should be more than or equalto, and less than or equalto, then replace the above code with:
--8<----------------------------
myInside:=H<=(Ref(H,-1) AND L>=Ref(L,-1);
Sum(myInside,3)=3;
--8<----------------------------
Please read the code sections VERY carefully and understand the differences....
Hope this helps.
wabbit :D
P.S. This information is all found in the MS Users Manual too!
|
|
|
|
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 you can extend the idea to count how many Inside days there have been....
--8<----------------------------
myInside:=H<=Ref(H,-1) AND L>=Ref(L,-1);
A:=myInside=1;
B:=myInside=0;
X:=Cum(A);
Y:=X-ValueWhen(1,B,X);
Y;
--8<----------------------------
NOTE: this is using >= and <= to define Inside days.
You could then explore for Y>=3........
Boy, these possibilities are endless!!!
wabbit :D
|
|
|
|
Rank: Member
Groups: Registered, Registered Users, Subscribers Joined: 3/18/2006(UTC) Posts: 10
|
|
|
|
|
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)
|
Candlestix, All
Firstly, you're welcome!
Secondly, if you are happy that your question has been sufficiently answered, can you please edit the subject of the original post and add [RESOLVED]. This way it makes life easier for all to see which matters have yet to attain suitable solutions, and which matters can be considered closed. This will alleviate the moderators from having to do it themselves (they work hard enough around here as it is!)
Thanks.
wabbit :D
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/12/2005(UTC) Posts: 141 Location: Brooklyn,NY
|
Hey Wabbit,
Thanks for the post -never knew how to do the resolved part,now I do
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Product and Service Development
»
MetaStock
»
Newie needs help with 3 inside days [RESOLVED]
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.