Deactivator

LatchRisk Management

The Deactivator node is the inverse counterpart of Activator. When its last non-null input value is non-zero, it calls engine.deactivateActions(), setting the global activated flag to false. The state remains false until an Activator node re-enables it.

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, engine.deactivateActions() is called, setting the activation flag to false.
  3. 3If the last value is zero or null, the activation flag is not changed.
  4. 4The output deactivated is !engine.getActionActivated() — i.e., true when the strategy is currently inactive.
SR Latch pattern: Pairing Activator (Set) and Deactivator (Reset) creates an SR latch. The activation state is set by whichever node fires last. Only one should fire at any given time; if both fire simultaneously, the result depends on graph evaluation order.

Activator vs Deactivator

NodeEngine callEffectOutput field
ActivatorsetActionActivated(true)activated → trueactivated: boolean
DeactivatordeactivateActions()activated → falsedeactivated: boolean

Parameters

This node has no configurable parameters.

Inputs & Outputs

PortTypeDescription
Input
input(number | null)[]Boolean signal. A non-zero last value deactivates the strategy.
Output
deactivatedbooleantrue when the strategy is currently inactive (!engine.getActionActivated()).

Use Cases

Drawdown circuit breaker

Connect a Max Drawdown node output to Deactivator. When daily drawdown exceeds a threshold, the strategy is automatically deactivated for the rest of the session. Re-activate next day by connecting a time-based signal to Activator.

Regime filter

Use a volatility indicator (e.g. ATR > threshold) to trigger Deactivator, halting entries during high-volatility regimes. When volatility normalises, the Activator fires and resumes normal operation.