cross

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

1 on a bar where a crosses above b, -1 where it crosses below, 0 elsewhere.

Parameters

NameType
aArrayLike | float
bArrayLike | float

The result is an int8 array, the event form of crossover and crossunder (the two never hold on one bar). Example: ta.cross(fast, slow).