within
forge.signalsfunctionSince Forge API 1
Signaturepython
forge.signals.within(condition: np.ndarray | ConditionTree,bars: int,/) -> np.ndarrayTrue where the condition was true on this bar or one of the bars - 1 before it.
Parameters
| Name | Type |
|---|---|
| condition | np.ndarray | ConditionTree |
| bars | int |
within(rsi < 30, 5) is "RSI went under 30 in the last five bars". Build
2026-10-19-forge-wiring, P3-S03: the Strategy Spec's within node runs through it, as do
held, bars_since, armed and count_true below for theirs.