then

forge.signalsfunctionSince Forge API 1
Signaturepython
forge.signals.then(first: np.ndarray | ConditionTree,second: np.ndarray | ConditionTree,/,*,within: int,name: str | None = None,note: str | None = None) -> ConditionTree

True where second becomes true, if first became true 1 to within bars earlier.

Parameters

NameTypeDefault
firstnp.ndarray | ConditionTree
secondnp.ndarray | ConditionTree
withinint
namestr | NoneNone
notestr | NoneNone

Only the bar each one becomes true counts. The bar first became true is not counted in the window, so both becoming true on the same bar is not a sequence. within=5 means second on any of the 5 bars after first's bar.