The CROSSES OVER operator in ProBuilder language is used to determine if one data series (typically a moving average or other technical indicator) has crossed over another data series from below to above. This is commonly used in trading strategies to identify potential buy signals or trend reversals.
a CROSSES OVER b
Where a and b are data series or indicators. The operator returns a Boolean value (TRUE or FALSE).
Consider you want to check if a 20-period exponential moving average (EMA) of the closing price crosses over a 50-period EMA of the closing price. You can set this up as follows:
a = ExponentialAverage[20](close)
b = ExponentialAverage[50](close)
signal = 0
IF a[1] CROSSES OVER b[1] THEN
signal = 1
ELSE
signal = 0
ENDIF
RETURN signal AS "Bullish Signal"
In this example, a represents the 20-period EMA and b represents the 50-period EMA. The script checks if the previous value of a (a[1]) crosses over the previous value of b (b[1]). If true, it sets the signal variable to 1, indicating a bullish signal; otherwise, it remains 0.
Understanding and utilizing the CROSSES OVER operator can help in creating effective and responsive trading strategies within the ProBuilder environment.