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
- 1The node scans the input array from the end, finding the last non-null, non-undefined value.
- 2If that value is non-zero,
engine.deactivateActions()is called, setting the activation flag tofalse. - 3If the last value is zero or null, the activation flag is not changed.
- 4The output
deactivatedis!engine.getActionActivated()— i.e.,truewhen 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
| Node | Engine call | Effect | Output field |
|---|---|---|---|
| Activator | setActionActivated(true) | activated → true | activated: boolean |
| Deactivator | deactivateActions() | activated → false | deactivated: boolean |
Parameters
This node has no configurable parameters.
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Input | ||
| input | (number | null)[] | Boolean signal. A non-zero last value deactivates the strategy. |
| Output | ||
| deactivated | boolean | true 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.