CROSSES OVER

Category: Instructions

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.

Syntax:

a CROSSES OVER b

Where a and b are data series or indicators. The operator returns a Boolean value (TRUE or FALSE).

Example:

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.

Additional Information:

  • The CROSSES OVER operator is particularly useful in trend-following strategies where moving averages are a key component.
  • It is important to use historical data (like a[1], b[1]) to avoid lookahead bias in trading strategies.
  • This operator can be used with any indicators or data series, not just moving averages, as long as they can be logically ordered.

Understanding and utilizing the CROSSES OVER operator can help in creating effective and responsive trading strategies within the ProBuilder environment.

Related Instructions:

  • CROSSES UNDER instructions
  • Logo Logo
    Loading...