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.
  • Bars Since — Bars elapsed since the input condition was last true (0 on the bar it fires, then 1, 2, …). NaN until the first occurrence. Gate entries on event recency ('signal fired ≤ N bars ago').
  • 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'.
  • Gate — Pass the value through only while the gate signal is true; otherwise emit NaN ('no value'). A clean enable/disable switch for a sub-signal — e.g. only feed a stop distance to the Tester during a chosen session.
  • 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'.
  • Once Per — Pass the input signal through only the FIRST time it's true after each reset, then suppress it until the next reset. Wire NewSession into Reset for 'one entry per session'; a day-of-week change or any edge works too. Reset unwired → fires only once ever.
  • 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).
  • Rolling Count True — How many of the last N bars the input was true. Pair with a threshold for 'N-of-M' confluence ('≥3 of the last 5 bars confirmed'). NaN during the first N-1 warmup bars.
  • Running Max (since reset) — Highest value seen since the last reset (or since the start if unwired). Wire an entry pulse to Reset for 'highest-high since entry' — the anchor for trailing stops and MFE.
  • Running Min (since reset) — Lowest value seen since the last reset (or since the start if unwired). Wire an entry pulse to Reset for 'lowest-low since entry' — the anchor for trailing stops and MAE.
  • Sequence (A then B) — True on a bar where B is true AND A was true within the last N bars — 'A happened, THEN B within N'. The ordered-confluence primitive for setups like break→retest, cross→pullback, sweep→confirmation.
  • Value When — Capture the value of X on the most recent bar the condition was true, and hold it until the next occurrence. NaN before the first. E.g. 'the RSI at the last swing high', 'price at last signal'.