Skip to content

Flow

Route and gate logic — branch, latch, and control when conditions fire.

  • Bar Count — Count bars since the start, or since the optional reset signal last fired. Output is a SERIES of integer counts (0-based — bar of reset is 0, the next bar is 1, etc.). Useful for 'bars since entry', 'bars since session start', anything time-since-event.
  • Cooldown — Allow the input signal to fire, then suppress it for N bars before allowing another fire. Prevents revenge entries — 'don't take another long for 20 bars after the last entry/stop-out'.
  • If / Then / Else — Per-bar branching: when condition is true, emit if_true's value; otherwise emit if_false's. The visual equivalent of condition ? a : b. Bars where condition is missing emit NaN — engine treats as 'no value'.
  • Latch — SR-flip-flop: once set fires true, output stays true until reset fires. If both fire on the same bar, reset wins (safe default — 'reset has priority' avoids stuck-on bugs). Useful for 'arm a trade after structural break, hold the green light until the break is invalidated'.
  • Persistence — True at bar i only if the input signal has been true for ALL of the last N bars. Filters out flickering signals — 'RSI > 70 for 3 consecutive bars' instead of any single bar's spike.
  • Pulse — Emit true only on bars where the input transitions from false to true — fires once per crossing instead of every bar the condition stays true. Essential for entry signals (otherwise 'RSI > 70' fires N times in a row and the engine tries to open N positions).