crossunder

Crossunder detection (source1 crosses below source2)

crossunder(source1, source2)

Parameters

Crossunder - crossunder(source1, source2)

Detects when source1 crosses below source2.

  • source1 (field): First data series
  • source2 (field): Second data series

Formula


Crossunder when:
  current: source1 < source2
  previous: source1 >= source2

Examples


// price crossed below 20-day SMA
crossunder(close, sma(close, 20));

// fast EMA crossed below slow EMA (death cross)
crossunder(ema(close, 12), ema(close, 26));

// RSI crossed below 70 (overbought exit)
crossunder(rsi(close, 14), 70);

Returns

Boolean: TRUE when crossunder occurs, FALSE otherwise

See Also