crossunder

Crossunder detection (source1 crosses below source2)

crossunder(source1, source2)

Parameters

Name Type Description
source1 field First data series
source2 field Second data series

Formula

crossunder = (source1 < source2) AND (source1[1] >= source2[1])

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

bool — may be NULL

See Also

crossover, cross