Interpreting Cross Results for Fast and Slow Indicator Lines
Summary
The document explains a function that compares two indicator arrays and reports how many recent periods have passed since their lines crossed. A positive result means the first array is above the second after an upward crossing; a negative result means it is below after a downward crossing. Reversing the array order reverses the interpretation, so identifying which array represents the fast or slow line matters when labeling a cross as bullish or bearish.
The described implementation scans backward from the latest values, counts consecutive periods on one side of the other, and stops when it encounters the prior opposite relationship, equal values, or a nonnumeric value. It rejects arrays of unequal length. A sample pair of arrays produces results of 3 and -3 when the arguments are swapped, illustrating the sign change and three-period count. The note does not discuss how to use crosses in a trading strategy or how to handle missing data beyond stopping the scan.
Key ideas
- Cross compares two equal-length indicator arrays and reports the recent duration and direction of their relative position.
- A positive result indicates the first array is above the second after an upward cross; a negative result indicates the reverse.
- Swapping the array order reverses the result's sign and changes the signal interpretation.
- The scan stops at equal values or nonnumeric data, limiting what the returned count represents.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.