Activator

LatchRisk Management

The Activator node reads the last non-null value of its input signal. If that value is non-zero, it sets the global activated flag to true on the graph engine. This flag remains true until a Deactivator node explicitly turns it off — it does not automatically reset each bar.

How It Works

  1. 1The node scans the input array from the end, finding the last non-null, non-undefined value.
  2. 2If that value is non-zero (truthy), engine.setActionActivated(true) is called.
  3. 3If the last value is zero or null, the activated flag is not changed — it holds whatever state was set previously.
  4. 4The output activated reflects the current engine state after the check.
Latching behavior: Activator is a set-only latch. Once activated, it stays activated across re-renders and live bar updates until a Deactivator node resets it. Use Deactivator to pair with and create a controlled on/off gate.

Parameters

This node has no configurable parameters. It operates purely on its input signal.

Inputs & Outputs

PortTypeDescription
Input
input(number | null)[]Boolean signal. A non-zero last value activates the strategy.
Output
activatedbooleanCurrent activation state of the graph engine after processing.

Use Cases

Trend-gated entry

Connect a Compare node (e.g. price > 200-period MA) to Activator. Entry signals only execute while the activation flag is true. Connect a second Compare (price < 200-period MA) to Deactivator to disable entries in downtrends.

Session-based activation

Fire Activator when a time-based condition becomes true (market open) and Deactivator when it becomes false (market close). This gates all risk logic to active trading hours only.