Skip to content

Gate

Flow · Branch

Gate node on the canvas

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.

Gate is an enable/disable valve for a series. It passes the value straight through while the gate signal is true, and emits NaN ("no value") whenever the gate is false. It's the clean way to switch a sub-signal on and off without altering the value itself.

How it works

Two inputs: a value series and a gate signal. Each bar, if the gate is true the output equals the value; if the gate is false the output is NaN. NaN reads downstream as "no value," so a gated-off stop distance or level simply doesn't apply on those bars. Lookahead-free, no parameters.

When to use it

Use it to make a value conditional: only feed a stop distance to the Tester during a chosen session, only expose a level while a trend filter agrees, or mute one branch of a composite while a regime flag is off. Where And gates signals, Gate gates values — pass-through-or-nothing.

Example

Session-only stops: build a stop distance, then Gate it with a session filter so the stop value is only live during London hours; outside the session it's NaN and the strategy uses its default. Wire the gated value into the Tester.

Tips & gotchas

  • Gates a value, not a signal — for boolean logic use And.
  • Off → NaN, which downstream treats as "no value" (not zero).
  • The gate input must be a signal; the value can be any series.

Inputs

Socket Type What to wire in
Value series / bars Series to gate. BARS uses close.
Gate signal Pass the value through on bars where this is true.

Outputs

Output Type Plots as Description
Gated series Line · sub-pane Value where the gate is true, else NaN.

Reference auto-generated from the block catalog · category Flow.