Skip to main content

Overview

This page documents 3 operators (role: CONTROL).

ConditionalGate

Gate operator that outputs 1 or 0 based on condition. Used to conditionally enable/disable downstream operators (especially semantic operators that make API calls). Output:
  • 1.0: Condition is met (gate open)
  • 0.0: Condition is not met (gate closed)
Downstream operators can use this as gate_input to skip expensive operations when the gate is closed. Example:

Open gate when ATR above 2%

graph.add_node(“high_vol_gate”, ConditionalGate( condition_input=Input(“atr”, timeframe=“1h”, lookback=1), threshold=0.02, comparison=“gt”, ))

Open gate when RSI below 30 OR RSI above 70 (using two gates)

graph.add_node(“oversold_gate”, ConditionalGate( condition_input=Input(“rsi”, timeframe=“1h”, lookback=1), threshold=30, comparison=“lt”, )) graph.add_node(“overbought_gate”, ConditionalGate( condition_input=Input(“rsi”, timeframe=“1h”, lookback=1), threshold=70, comparison=“gt”, ))

Combine gates with OR logic (max of two gate values)

graph.add_node(“extreme_rsi_gate”, GateOr([ Input(“oversold_gate”, timeframe=“1h”, lookback=1), Input(“overbought_gate”, timeframe=“1h”, lookback=1), ])) Role: CONTROL | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/control/gate.py

GateOr

Combine multiple gates with OR logic (max of gate values). Role: CONTROL | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/control/gate.py

GateAnd

Combine multiple gates with AND logic (min of gate values). Role: CONTROL | Ephemeral: No

Parameters

Usage

Source Code

Full compute() implementation — no hidden logic.
Source: apps/trading/operators/control/gate.py

Operator Protocol

How operators implement the compute() interface

StatefulGraph

How operators compose into a DAG