crossover

forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.crossover(a: ArrayLike | float,b: ArrayLike | float) -> np.ndarray

True on the bar where a goes from at or below b to above it.

Parameters

NameType
aArrayLike | float
bArrayLike | float

a[i] > b[i] and a[i-1] <= b[i-1], with all four values present; the first bar is false. A touch followed by a move away counts as a cross. Either side may be a plain number, such as a level, but not both. The result is a true or false array, which a strategy's entry field takes as it is. Example: ta.crossover(fast, slow).

Used in