Rank: Member
Groups: Registered, Registered Users Joined: 6/29/2007(UTC) Posts: 19
|
Hello all,
I've had Metastock for all of about 1 week now, and I need a primer on how to use the "cross" function. I've looked at the help files, and lots of formula's, but I don't understand the number references. I think if somone could build a quick formula for me and explain the references, it would go along way towards my knowledge growth.
How about this. Build a formula that signals when the Williams%R climbs through a -50 level. That will get me headed down the right path.
Thank you in advance,
j32driver
|
|
|
|
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)
|
J32
In Example 1 Cross() plots a TRUE when WillR(14) crosses from below to above -50.
{Example 1}
Cross(WillR(14),-50)
A Cross() function requires 2 bars of data to generate a result – a "before" bar and an "after" bar. Both parameters in a Cross() function can be variables, or one can be constant (for obvious reasons both can't be constants). It's important to remember that a cross occurs when the first parameter crosses from below the second parameter (before) to above it (after). To signal a cross in the reverse direction just change the first and second parameter.
In Example 2 Cross() plots a TRUE when WillR(14) crosses from above to below -50.
{Example 2}
Cross(-50,WillR(14))
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 6/29/2007(UTC) Posts: 19
|
Perfect! Thank you Roy. The use and reversal of the "data array 1, data array 2" in the help section is what I didn't understand. You explained it perfectly!
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 6/29/2007(UTC) Posts: 19
|
Ok... one last question and I think I'll be set for a while. I want a signal to be generated when W%R decreases by a set amount... say 20 for example. I don't have any idea where to start for this one.
Thank you in advance!
|
|
|
|
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)
|
J32
The following formula will return a TRUE when WillR(14) drops by more than 20 from one bar to the next. You didn't say over what time frame the change was to take place so I've assumed 1 bar only for these first two examples.
WR:=WillR(14);
WR-Ref(WR,-1) < -20;
Or you could write it this way.
WR:=WillR(14);
Ref(WR,-1)-WR > 20;
Here's how you could signal a drop of more than 20 occurring over a maximum of 2 bars.
WR:=WillR(14); WR;
Ref(HHV(WR,2),-1)-WR > 20
Roy
MetaStock Tips & Tools
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 6/29/2007(UTC) Posts: 19
|
Been awhile since I've dropped in. Just wanted to say a quick thank you to Roy for the help. It is greatly appreciated!
|
|
|
|
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.