FollowedBy, FollowedByWithin, FollowedByWithinInc

Top  Previous  Next

Chart for this topic:  Followed By Indicators.cht

 

The FollowedBy indicator returns a 1 for true when a Condition1 is followed by a Condition2.  Other times it returns a zero.  There are several versions of this indicator:

 

FollowedBy(condition1, condition2)

Parameters:

Condition 1 – a time series that must be a condition that defines the first condition of a series (use a True/False condition rather than the default value of Close)

Condition 2 – a time series that must be a condition that defines the second condition of a series (use a True/False condition rather than the default value of Close)

 

Returns a value of 1 (true) on the first, and only the first,  occurrence of a true conditon2 after a true occurrence of condition1.  At all other times it returns a value of 0 (false).

 

Note that FollowedBy(FollowedBy(condition1, condition2), condition3) is possible.

 

FollowedByWithin(condition1, condition2, bars)

Parameters:

Condition 1 – a time series that must be a condition that defines the first condition of a series (use a True/False condition rather than the default value of Close)

Condition 2 – a time series that must be a condition that defines the second condition of a series (use a True/False condition rather than the default value of Close)

Bars - an integer greater than or equal to 1 or a calculated time series

 

Returns a value of 1 (true) on the first, and only the first, occurrence of a true conditon2 after a true occurrence of condition1 if the number of bars between conditions 1 and 2 is less than or equal to the value of the Bars parameter.  (The FollowedByWithin indicator does not include the bars when Condition1 and Condition2 occur in the number of bars counted.)  At all other times it returns a value of 0 (false).

 

FollowedByWithinInc(condition1, condition2, bars)

 

Same as FollowedByWithin except that it counts the bars on which Condition1 and Condition2 occur.

 

Note:  These indicators use close as a default parameter value when a condition is required. Close is a non-zero value so it is always a true condition.  However, you should not pay attention to these indicator results until you change the close to a condition that may be either true or false.