Docs

ta.crossunder

Flag the bar where one series moves down through another.

itm
ta.crossunder(a, b)

True on the bar where a falls from at-or-above b to strictly below b.

Parameters

A series parameter takes a value on every bar. A constant parameter must be known before the first bar, such as a number or an input.

NameKindTypeDefaultRangeDescription
aSeriesnumber--The series to read.
bSeriesnumber--The series to read.

Output

NameType
valuebool

Warm-up and missing values

Warm-up
2 bars.
Missing values
false while either series is na on this bar or the previous one.

Example

itm
ta.crossunder(fast, slow)
itm
down = ta.crossunder(ta.ema(close, 9), ta.ema(close, 21))
plotshape(down, style=arrowdown, location=abovebar)