Skip to main content

ta.crossunder#

True when series a crosses BELOW series b at bar i — i.e.

SYNTAX#

function ta.crossunder(a: (number | null)[], b: (number | null)[], i: number): boolean

ARGUMENTS#

  • a ((number | null)[]) — Primary series.
  • b ((number | null)[]) — Reference series. Same length as a.
  • i (number) — Current bar index. First valid output at i = 1.

RETURNS#

boolean — true on the bar of the crossunder.

REMARKS#

Mirror of ta.crossover. Pure event detector.

EXAMPLE#

if (ta.crossunder(fastEma, slowEma, i)) {
  plot.marker('cross-dn', candles[i].high, { color: '#ef5350', shape: 'triangle-down' });
}

SEE ALSO#

ta.crossover, ta.change