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) -> ConditionTreeTrue where second becomes true, if first became true 1 to within bars earlier.
Parameters
| Name | Type | Default |
|---|---|---|
| first | np.ndarray | ConditionTree | |
| second | np.ndarray | ConditionTree | |
| within | int | |
| name | str | None | None |
| note | str | None | None |
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.