logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Brent  
#1 Posted : Tuesday, December 3, 2013 8:51:20 PM(UTC)
Brent

Rank: Member

Groups: Registered, Registered Users
Joined: 10/22/2007(UTC)
Posts: 14

I want to stop getting repeating signals. How can I ignore a buy signal if the previous signal was a buy signal.
mstt  
#2 Posted : Wednesday, December 4, 2013 2:28:43 AM(UTC)
mstt

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)
Hi Brent

If you want to convert a group of contiguous TRUE signals (the existing formula output) into just the leading edge (the first TRUE) then it's quite simple. Give the output a name, "Signal" for my example, and then add a new output line.

Signal=TRUE AND Alert(Signal=FALSE,2);

Since "=TRUE" is assumed by MetaStock this can be removed from the output expression to shorten it. TRUE and FALSE can be represented by "1" and "0" respectively, and the AND logical operator can be substituted by "*" to shorten the expression further.

Signal * Alert(Signal=0,2);

What this says is that Signal is TRUE on the current bar but was FALSE on the previous bar. This could also be written as

Signal AND REF(Signal,-1)=0;
or...
Signal * REF(Signal,-1)=0;

I'd discourage the use of the Ref() function whenever possible because each time it's used it unfortunately injects one or more N/A bars into the final forrmula result. ValueWhen() is a better option for generating delays, but for the exercise above the Alert() function is the most appropriate.

If your question relates to eliminating a group of non-contiguous signals then you'll need to describe the problem situation in more detail.

Roy

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.