Node reference

Bars Since

How many bars since a condition last fired.

Rev. 2026.06

Bars Sinceindicator
InputsOutputs
Condition
condition · boolean
Bars Since
Bars Since
main · number

What it does

Counts bars since the wired condition was last true: 0 on the firing bar, N for N bars ago, −1 if it never has.

What happens

Each candle it checks the wired condition and updates the count. The output is a bar count, not a boolean.

When to use

Cooldowns ('no re-entry within 5 bars') and time-based exits.

Gotchas

  • −1 means it has never fired — guard for that before comparing.
  • Wire a boolean condition as the trigger, not a number.